Forum Discussion

DolandRuiz's avatar
DolandRuiz
Community Member
3 years ago

"When variable changes" is not necessary

Instead of:

Jump to slide Maze
When menu_choice changes
If menu_choice = Maze

It should be:

Jump to slide Maze
If menu_choice = Maze

That "when variable changes" line was messing me up and wasted a lot of my (not billable) time. I have a menu with five buttons and for example if you click on the Maze button it'll take you to the Maze slide. 

But if you go back to the menu and want to click on the Maze button again, well it wouldn't take you there because the variable menu_choice was already set to Maze and therefore did not change.

I finally figured it out by exposing the variable (trace) and seeing how that variable stayed on the last one that was chosen when you return to the menu.

I then simply added a reset trigger and it worked. Btw, the slide settings for "When revisiting, reset to initial state' did not reset the variable.

Let's make this a feature change? We can keep the "when variable changes" line as an option if we need it, but we should be able to choose the simpler code, no? What say you ?

  • I don't know why you're even using the variable condition in that trigger. Just jump to the proper slide when the user clicks the button. (If you're using the variable to track progress, that's fine. But it doesn't need to be involved in the jump-to programming.) 

    BTW, it's standard programming that a variable will only change when a trigger changes it. Variables are often used on multiple slides. It could cause a lot of problems if a variable was automatically reset when the user returned to one of the slides.