Trouble with variables staying constant across slides

Hi all, 

I am trying to restrict users from moving forward through content until they have completed two sections. The restriction comes from a hidden NEXT button, which is only revealed when the two sections have been completed. 

One section is housed on Slide 1, Layer 1. The other section is housed on Slide 2, as it has many, many layers. I have it set so that when the user clicks on section one, Variable1 is increased by 1. When the user clicks on section two, Variable1 is increased by 1. On variable change, if Variable1 >= 2, then change NEXT button to normal. 

However, it does not seem to be working. I thought variables were persistent across slides; but it seems that as soon as I click Section 2 - which takes the user to Slide 2, the variable loses track, and no change is recorded on Slide 1. 

Any help here would be massively appreciated - I'm going a bit crazy!

Cheers. 

4 Replies
Ned Whiteley

Hi Olli,

Variables will indeed work throughout a project and can be incremented on any number of slides and their current state viewed or used to trigger an action at any time throughout a course.

If your variable is not incrementing when you jump from slide 1 to slide 2, it sounds like you may have your triggers in the wrong order. Make sure that the trigger to adjust the variable is above the one that jumps the user to the next slide when (presumably) a particular button is clicked. The variable has to be incremented before the slide loses focus, which it will do immediately the user is jumped to another slide.

If this is not the problem, are you able to post a copy of your project file here as that would be very useful in trying to solve your problem?

Math Notermans

Added a simple setup to show it working. A few things you might have missed. Slide properties for the slide layers might cause variables not to work correctly or the order of your triggers. Hard to tell what was wrong with your setup without seeing it, but as you can see it works fine.

Walt Hamilton

as soon as I click Section 2 - which takes the user to Slide 2, the variable loses track, and no change is recorded on Slide 1.

This indicates to me that the it is not a problem with the variable, but the trigger. The trigger is initiated by the variable change, but if the variable is changed on slide2, slide1 can't hear it change. Slide1 can hear a variable change only when it is open. Check Math's story, and you'll find a way to fire the trigger that will work for you.

 

Olli Wynyard Gonfond
Ned Whiteley

 Make sure that the trigger to adjust the variable is above the one that jumps the user to the next slide when (presumably) a particular button is clicked. 

This was the problem! The slide was getting changed, and then no longer adding to the variable! What an amazing community this is. Thank you all so much for your help, and to Ned for this solution.