Revealing the switching mechanisms of an off-on-off fluorescent logic gate system.