Forum Discussion
Infinite Toggle
Done a lot of looking and there's much out there about toggles of various kinds, but I've found nothing that quite meets my criteria... I simply want to be able to click a hotspot and toggle two sets of numbers, from one to the other- indefinitely. I've attached a snip of the graphic setup- If the user clicks on the hotspot over the switch, the numbers in the window change from '310' to '420'. A subsequent click on the hotspot returns the number to '310' and back to 420 if clicked again. I can set it up so that it works once from 310 to 420, but can't figure out how to toggle it back to 310 and repeat. I know that I'll have some users who will try to toggle multiple times, so I don't want any limitations on the number of clicks. Ideas?
- WaltHamiltonSuper Hero
- JeffNaumanCommunity Member
Walt,
Thank you! This works like a charm although I must admit, it will take a while to understand the ‘toggle variable’ idea and the =NOT Assignment operator. Never understood it, so I never used it so I’d have been looking a long time for this solution! 😎
Jeff
- WaltHamiltonSuper Hero
Jeff,
The variable is a necessity because it serves as an independent "3rd party" to the action. Otherwise, your triggers are something like"Change state of text box to B if it is A", followed by "Change state of text box to A if it is B". You can see how that would always end up with the text box in a state of A.
The "NOT assignment" only works for variables that can have only two options, and at present for SL, that means True/False. Think of it as meaning "Change it to the value which it is not. That gives you the ability to change it without having to know or reference what it currently is.
Just change it (whatever its current value),to the other value, and then depending on its new value, change the state of the text box.
- JeffNaumanCommunity Member
Thanks again, Walt. I've studied it some today and it made complete sense. I realize now that the 'toggle' instruction in the object trigger is generated if you use the NOT ASSIGNED parameter. Your response was just what I needed.
Sent from BlueMail
- AlexYoung-83208Community Member
Looking for a basic toggle effect. Try this video