Trigger not working when condition added

I'm working with one of the interactive tables, Einstein's Riddle, from yesterday's E-Learning Heroes email.  I wanted to change the strikeout triggers on the hints so that they could be returned to the Normal state, if desired, by clicking them again.  I added a condition to hint-1 so that the state would be changed to "Striked" when the hint was clicked only if the current state was "Normal."  I then added a second trigger for hint-1 that changed the state to "Normal" when clicked if the current state was "Striked."  When I previewed the slide clicking on hint-1 did not change the state at all.  All of the other hints worked as originally designed because I hadn't changed them.  There are no conditions on those triggers.  I don't understand why the conditions I added are causing the triggers on hint-1 to fail.

4 Replies
Walt Hamilton

I suspect that you are thinking like a programmer, and think this is an if ... then ... else, but SL has no else.

Every trigger in a sequence is always evaluated and in order.

So if the object is in "Normal, the first trigger turns it to "Striked", THEN the second trigger finds it in "Striked" and returns it to normal.  If you switch the order of the triggers, you'll find that they switch which one will work. The problem is that the state changes between trigger one and trigger two.

To get that to work, you need a neutral third party, like a T/F variable that can be toggled after all the changes are finished, or like Michael pointed out, the built-in "Selected" state. You can create your own variable, and change it, too, if you want. Change the states using as a condition the value of the variable, then the variable on the basis of the states.

If variable is red, change state to blue.

If variable is blue change state to red.

 If state is blue, change variable to blue.

If state is red, change variable to red.

This works because the variable doesn't change between triggers one and two, and the state doesn't change between triggers three and four.