Forum Discussion
Button Set State/Variable Issue
Good day. I have a slide with 5 buttons that I can't seem to get the variable to work correctly. Here is what I would like it to do:
- User clicks button #1, the layer shows and then hides at the end of the timeline. This triggers button #2 to change to a normal state. Button #1 goes to a "watched" state.
- User clicks button #2, and it works the same as #1 but triggers button #3 to a normal state and so forth.
- If the user clicks on any of the previously watched layers, the next button in line does NOT go to a normal state but rather stays in a "watched" state (if already in this state).
- I've created a variable that the button is changed to "True" when the user clicks the button.
- Finally, I have a trigger on each button that changes the state of the button to "normal" from the default disabled state only if the watched variable is a value of False.
It works perfectly for button #1 and #2 but after that, the state of #3 stays disabled. I've doubled checked the variable and trigger and everything is the same as #2 so I'm stumped as to what the problem is or I'm crossed-eyed and don't see it. I've attached a sample file so you can view my mess.
Any help from the community is greatly appreciated. Thank you.
- BenMcKenna-ba88Community Member
The reason the first button works is because the Watched variable starts as False (which meets the first condition check requirements), then gets set to True, but never gets set back to False (so the other condition checks never pass).
If you set it back to False on each slide layer, your buttons will revert back to their normal state though (which it sounds like you don't want). Instead of relying on a global 'Watched' variable, it's better to reference the states of your buttons for the condition checks, since the variable doesn't know which video was watched (whereas the states sorta function as their own 'local' variable).
I've also set the layers to prevent clicking on the base layer, so the user can't activate two layers at once.
https://360.articulate.com/review/content/beec8209-e281-4c7d-85d6-c29fab41fd68/review
- SharonPlunk-1f3Community Member
Ben, thank you so very much for the resolution of this slide. I knew I was close but was over thinking it! Thanks again.