Using Variables to Control Slide Advancement

Oct 02, 2019


Still figuring out all of the cool things that Storyline can do and I am not sure if I am using variables correctly.

I have four buttons that I want the learner to click on before they can advance to the next slide. The button states are set to change when selected to display some additional content. However, because of this I can't get them to stay as "visited" and use that to control slide advancement.


I thought I could use a variable. I have added a variable to count the number of clicks. In the trigger wizard I have a condition to advance to the next slide if  the "CountClick" variable is greater than or equal to 4 clicks  (4 buttons I want them to click on). When I test it doesn't seem to be working. Am I thinking about this the wrong way or missing a step someplace?





26 Replies
Wendy Farmer

Hi Marisa

when they click the four buttons are they navigating away from that slide to other slides then coming back?

If so, your trigger should be change state of Next button to normal when timeline starts (slide with the buttons) on condition that button1=visited and button2=visited and button3=visited and button4=visited and have the slide property revisit option set to 'resume saved state'.

If that is not your setup, perhaps you can share the story file or even just the few slides you're having the issue with by using the grey 'add attachment' button at the bottom of the post to upload.  From email, select the View button not Reply, as Reply doesn't allow attachments to display in the forum.

Hope this helps or gets you a step closer :-)

Wendy Farmer

No worries I'll take a look.

For your information the built in SL states have default behaviour and do not need triggers to show these states SL does it automatically and to use triggers sometimes causes issues because it's a conflicting instruction to SL.

Selected - object will stay in this state until another object is clicked - then it is no longer selected

Visited - object will be in this state when user clicks 

Hover - object will show hover state when mouse hovered over.

Here is the KB article for more info.


Maureen Matsumoto

Hi Marisa

I could never get the built-in states to work properly for me to control objects on a slide so I create a custom state called "Done" for each button. I also change the color of the button when the state is "Done" so the learner knows which buttons have been selected.

I then create a trigger that changes the state of the button to "Done" when the button is clicked. You can also create a trigger to display your content when each button is clicked or selected.

The Next button is hidden when the slide's timeline begins.

I create a trigger to change the state of the Next button to "Normal" when the state of all four buttons changes to "Done."

Does that make sense?

Let me know if you have any questions.


Marisa Hubin

Hi Maureen,
That makes sense.

The issue that I am having is that I am using the state "selected" to show some additional content with each button. But I don't want this content to show when the other buttons are clicked on otherwise it would all overlap. Therefore, I am trying to get the content to display (through the selected state) when the button is selected, and then go back to a normal state so that when other buttons are selected content doesn't overlap. But then  I need to still get it to record that the button was visited so that I can use that to control whether or not the learner can advance the slide. Is that possible?

Marisa Hubin

Hi Phil,

Thanks! That's what I have done with the selected state. However, I am trying to control the slide advancement and don't want the learner to be able to advance without having seen each of the button's and the additional content. How can I control the slide advancement (next button being active) if each of my buttons returns to "normal" state when the next button is selected so that the screen isn't full of content.

Maureen Matsumoto

Hi Marisa

You can do that by using four (4) different states per button.

Hover (if you want a hover state)
Selected (Shows the content)
Done (hides the content and marks the state as done)

The Next button is hidden until all button are the state of Done.

I can post an example if you need one.


Randy Hill

Marisa, I think I am following this thread correctly. What you are wanting to do is have a true false variable for each of the buttons. When the user clicks the button it changes the variable to true. Your forward navigation can then be set to be available when variable 1 AND variable 2 AND variable 3 and so on are true. Hope this helps.

Maureen Matsumoto

Hi Marisa

Here is an example of what I described above.

If your layers overlap, you can add a trigger to close the layer when another button is selected.

If your layers cover the buttons on the base layer, add a close button to each layer. When I have the close button, I add a fourth state that lets the learner know which buttons they have already selected.

Let me know if you have any questions or if I am missing what you need.

This is the easiest way I know how to do this. If someone has an easier way, I would love to learn how to do it.

Randy Hill

Sorry Maureen, I must have missed that. That is odd, I use built in states all the time and have never had any issues with them doing what I want. I do know some people add in extra triggers that are not needed can interfere with the built in states but out side of that I would have to see the story file to diagnose.

Maureen Matsumoto

Hi Randy, no worries. I have the same problem that Marisa mentioned above. If I try to control something on my slide using the visited or selected built-in states, and the learner clicks on something else, it returns the state to normal and can mess up my slide restrictions. That is why I started using custom states. Maybe it is a bug that I should report?

Thanks again for your feedback. I always learn something from everyone here in the community!

Marisa Hubin

Hi everyone! I really appreciate all of the feedback--very helpful!

I ended up using a True/False Variable as Randy suggested and was able to get everything to work properly! I am guessing there is more than one way to do this but this route worked fine for me and I am happy to be able to continue working on the other parts of my course now!

Gia  Edwards

I'm doing something similar and I'm stuck.

I have the Next button set to Hidden when the timeline starts.

The base layer contains three speech balloons (callouts) numbered 1, 2, and 3.

When the learner clicks any one of the three, a layer appears that has one balloon containing text and two buttons (right/wrong).

When the learner clicks a button, a feedback layer appears.

The learner must click the Continue button to be returned to the base layer, where they can choose another possible response balloon (1, 2, or 3).

I want them to visit all three balloons before the Next button appears. I set this up with a Visited state for the balloons plus variables (described earlier in this thread) and it works - sort of. When I click the third balloon (it doesn't matter in which order I click them), the Next button appears. It stays there after I click right or wrong, and it stays there while the feedback layer appears.

Then I click the Continue button. I go back to the base layer - and the Next button disappears.




This discussion is closed. You can start a new discussion or contact Articulate Support.