Setting a variable when next button is used

Feb 03, 2021

Hi,

I was trying yesterday to set up a trigger for a variable which when the user selects/swipes the next button a variable for that slide eg Slide1 will be set as true.

When the user returns to the slide if Slide1 variable is true then a universal variable NEXT will be set as true overriding triggers which set NEXT to false when the timeline starts.

This didn't work. I have now set the variable to be changed when the timeline ends. This works.

This can have a negative impact if the timeline ends but other interactions required normally haven't been completed. The user can proceed without completing all pre-required tasks.

I tried setting a trigger for change variable SlideN to true when t=0 (zero on a timer variable) IF picture 1 and Picture 2 and Picture 3 states are all visited. 

Again this last one had no effect and I have no idea why.

Does anyone have any idea why these scenarios won't work?

3 Replies
Judy Nollet

Hi, Mark,

There's an easy way to ensure the user can't proceed until each slide's timeline ends: set the Menu navigation to Restricted. 

  • Restricted navigation automatically disables the Next button until the timeline ends. 
  • And it automatically keeps the Next button enabled when the user revisits the slide.
  • This works even if you don't show the built-in Menu. 

Okay. That takes care of non-interactive slides. 

For interactive slides, do this: 

  • Create a T/F variable with an initial value of False. 
  • Add a trigger that disables the Next button when the timeline starts with the condition that the variable is False. (This will override the built-in disabling/enabling.) 
  • Add a trigger that changes the state of the Next button to Normal when the conditions have been met (for example, when a set of buttons are all Visited).
  • Add a trigger that adjusts the variable to True when the conditions have been met. (This will prevent the Next button from disabling if the user revisits the slide.)

I hope this helps! 

Walt Hamilton

The trigger to set Slide1 to True when user clicks Next must be placed in the trigger list above the trigger to jump to next slide when user clicks Next. Otherwise, the jump will occur, and the trigger to set the variable will be forgotten. Then when the user returns to the slide, the slide must be set to return to initial state on revisit. That causes the timeline to start, and the trigger (Set Universal variable NEXT to true when timeline on this slide starts) will fire.

change variable SlideN to true when t=0 (zero on a timer variable) IF picture 1 and Picture 2 and Picture 3 states are all visited.

This will be more likely to work if it  is written as Set variable SlideN to true when variable t changes if variable t = 0 and (states are all visited).