Brain breaker: trigger order
Dec 22, 2017
Hi everyone,
I’ve made a traffic light simulation to explain conditional triggers to the team.
It contains a traffic light with 3 lights, which by default are all off. Click on a light to turn it on and to turn all others off. Click the same light again to turn it off. A variable displays the current light color on screen “red”, “orange”, “green” or “no color”.
It all works, but only if the of the triggers are in a specific order. I’d like to be able to explain clearly why this order is so important.
- If I first check to see if the light is off, then the variable gets the correct information
- If I first check to see if the light is on, then the variable is incorrect (always no color)
I know that the triggers are executed top to bottom, but I can’t explain why it’s going wrong in this case.
Who can offer a good explanation for this? Thanks in advance!
All the best,
4 Replies
It is often best not to use equal to normal instead use not equal to selected.
Most built in states will validate as normal.
If you added a button set you would only need triggers to assign the variable value.
I can't open your file because I only have SL2, but have a look at the attached example and see if that approach would work for you.
Thanks, hero Phil! problem circumvented, and it makes more sense to program it this way. kind regards, pieter
Tremendous. Thanks, Phil.
This discussion is closed. You can start a new discussion or contact Articulate Support.