Toggling between states in Storyline
Jan 04, 2013
Hi there,
I'm sure there is an easy way to do this but I'm having trouble figuring it out! I have a slide with acronyms and I want the user to be able to click on each acronym to expand on it, and then click again to reduce it, back and forth as much as they want. I've created two states for the acronym - normal (abbreviated) and expanded.
so for example, if the acronym is 'NAD' and you click on it it becomes 'No Abnormalities Detected'.
I built the code as follows:
Change state of 'NAD' to Expanded when the user clicks.
Works just fine. Now how do I allow the user to click on it again to return it to normal state?
I tried adding a similar instruction with conditions, ie:
Change state of 'NAD' to Expanded when the user clicks, if the state of 'NAD' is normal.
Change state of 'NAD' to Normal when the user clicks, if the state of 'NAD' is expanded.
However this didn't work at all. So I changed the order of the two instructions and then it allowed expansion but wouldn't return to normal when clicking again.
Any suggestions how to make this work?
9 Replies
add a selected state and add your description in the selected state, this will toggle as much as you want
here is a file, to show, I used a button but anything can be used with a selected state
Oh my gosh, that's magic! Thanks!
That is awesome, you've made my day
Glad that this older conversation was able to help you as well, Gary.
Welcome to E-Learning Heroes :)
These are work-arounds, but why doesn't the logic of the triggers work. If I set a trigger to change a state from Normal to Hidden if the object is Normal, and another trigger to change the state from Hidden to Normal if the object is Hidden, why doesn't it work.
Hi Hillel!
I'd love to step in! Have you added conditions to the triggers?
I've tested this out on my end, and I didn't run into any snags. I started by setting a button to hidden as the initial state. Here are the two triggers I added.
If you have something different in mind, let me know! I'm happy to test it out on my end!
Hillel,
There is a problem with the logic you describe. That problem is that both triggers are executed every time. So if the object is Hidden, the first trigger changes it to Normal. Then since it is Normal, the second trigger changes it to Hidden.
Walt,
Thank you for the clarification! I get it - the trigger panel reads the triggers as a list and not simultaneously. So here is what I came up with if anyone else has this issue. It's pretty simple.
I created Variable1 as True/False and set it to be False (although it doesn't matter).
When the user clicks Oval1, the first trigger toggles Variable1 changing its value.
Only one of the next two triggers will take place, depending on the value of Variable1 i.e. the state of the TextBox6 will be determined by the value of Variable1.
Since Variable1 will change every time Oval1 is clicked, TextBox6 will toggle between the two states.
Thanks again for your help!
This discussion is closed. You can start a new discussion or contact Articulate Support.