Variables: Keeping object states persistent across slides

May 22, 2012

In an earlier thread, we used slide layouts to manage selected states across multiple slides and scenes. That's probably the best way if you're just showing button navigation states.

Another way you can manage states is by using a variable to evaluate which button object was clicked. From there, you can use triggers to change an object's states based on the current slide. Cool, right?

Using the same Notebook Tabs template, we'll move the folder and the tabs to the slide master. The reason is it reduced having redundant triggers on our main slides.



18 Replies
Janie Wood

This is a great solution... however I am having difficulties.  Is there a limit to the number of tabs?  I have 7 and I have hover and selected states created (from an image).

The selected states work great when I first click on a tab, but subsequent clicking results in multiple tabs retaining their selected and/or hover states. It does not keep the one tab I click on as selected.  Clicking on one tab, makes others change as well.  I've tried creating button sets and that has not helped.  I've cleared my cache and it doesn't fix the problem.

Any suggestions would be greatly appreciated!

David Anderson

HI Janie -

Thank you so much for posting your file. I had a look at your file and found the issue. The biggest issue was your slide master triggers were reversed. Trigger order matters so the issue was with first jumping to a slide before setting the variable -- reversing those triggers for each tab did the trick.

I recorded a screencast that captured my process for troubleshooting your file. You probably don't need it, but I'm adding it below just in case you wanted to see how I discovered the issue.

I also included some tips for how to work more efficiently with the sub tabs on each slide. You don't need to manually set the trigger for each hover state -- Storyline's hover states already include that default functionality.

Finally, I grouped the sub tabs as Button Sets to change their functionality. Button sets enable the buttons to behave like radio buttons where only one button object can be selected at one time.

I hope that helps! If it doesn't help or you have more questions, please let me know!


Video overview: view

Janie Wood

Hi David,

Thank you for working on my file and recording it!  Great to learn the importance of the trigger order.

Also liked putting the text onto the subtab buttons themselves and then defining the button sets.

Nice to know I don't need triggers for the hover states once they are created.

There is still some weirdness with the bright (periwinkle) blue staying on the top tabs (not sure where that color is coming from).

But, I am a lot closer to where I want to be!

I appreciate your time and help!


Eric Albertson

I am having trouble with this when the items that I want to have a persistent state on them are on layers in the master slide.  For some reason, the state reverts to the original state when I go to a new slide.

I am trying to have a persistent "completed" state on my custom made table of contents menu.  Right now, I have the table of contents menu (with several selectable buttons to jump to different sections) on a layer above the main layer in the master.  Using variables, for when a timeline end during a certain section, I have the state of the table of contents buttons change to "completed" (greyed out).  That works, but it doesn't stick when I go to a new slide.  Any suggestions?


Nora Cloonan

I don't know if this is the best forum for my question or not.  I am trying to get objects to change states both with true/false and number variables.  The problem seems to be that when the variable is set up on another slide, it won't trigger the state on the original slide.  I have some success with changing states on layers on the same slide with a true/false variable.

The catch with the number variable is that I want it to count up on multiple slides and not trigger the state change until it has reached a threshold.  I'm starting small with 2 but if successful would like to do more like 8-12.  I've confirmed the variables are counting using a %variablename% box on the slides to view the results.  So I'm either missing a step or something is wrong with my triggers.  I'm a new user and really getting confused and frustrated!

The two variables that are working are MontanaHistory and MontanaGeology.  The rest do not.



Ashley Terwilliger-Pollard

Hi Nora,

We're here - just sometimes takes a bit to get through all the posts, and if you respond again we may not see it right away reading oldest to newest. :-)  

If ever you need more immediate assistance, you can always connect with our Support team here for additional questions or start a brand new forum thread as well. 

I took a quick look at your file - and it seems that you're using the "when variable changes" as the trigger. This one can be a bit trickier, as it's looking for that variable to change on that slide - so if it's changing the slide before, than the trigger will never execute. Maybe instead you could look at changing it when the slide timeline starts or the user clicks on a particular element? Here is some additional information on working with variables and triggers that may also help you out. 

Nora Cloonan

I've read all of the info I can find on Variables and Triggers already.  I'm afraid I don't understand your reply.  You say I shouldn't use "when variable changes" as the trigger.  What other option do I have?  I've tried using when the timeline starts also and that doesn't work either.  It also defeats the purpose of having the learners view the slides when there are so few.  They can click away from them at anytime because this is designed to be very free-form.  Is there no way to make sure they view a specific number of slides as a requirement before the state changes to show completion?  



Ashley Terwilliger-Pollard

Hi Nora,

Sorry for any confusion - I'll try to explain a bit further using an example from your course. Looking at slide 5.1 - the first trigger is to change the state of "txt mesa np" to visited "when the variable MESA changes" - but if you look on that slide, the variable Mesa is not being adjusted. Therefore, the slide is waiting to see the variable change before making any additional adjustments.

If you want the user to visit both slides 5.3 and 5.4 before the state of "text mesa np" changes to visited, and since the only path to get to 5.4 is by going through 5.3, could you set the slide in 5.1 to "reset to initial state" and then change the trigger to allow it to change when the timeline starts? Take a look at the changes I made on slide 5.1 to see if that'll work. I just left that scene to make it easier to upload. 


As a side note, I also noticed you had two separate conditions set up  for that variable's value of greater than or equal to - and I did want to make note that there is a condition that includes both of those so you don't need to add them separately. 

Nora Cloonan

I really appreciate the time you must have spent formulating this response.  Let me tell you, I have a fabulous husband who, even though he does not know Storyline, he does understand software and he's been helping me interpret.  I have an extremely visual mind and it hard for me to take the words you write and form a clear picture in my head.  It didn't make sense to me when you said the change wasn't taking place on the slide when I put a text box on the slide that says %Mesa% and it showed the change taking place.  Well, my husband explained it in a way that helped me understand it isn't about what I see on the surface but rather about what the code is doing in the background.

So I may have found a solution to the number variable issue which should work in all cases.  Since I want my users to visit the slides but they are in random order, I have the variable counting up when they spend a set amount of time on each slide.  Then I placed the same variable on the slide with the object that the state is supposed to change.  On this one there is a minimum set that is equal to the number of slides.  So when they return after visiting 2 slides, it will count up to 3 and the state will change.  It is working on the first one I tried.  I'm happy with this.  I do realize it will get more complicated as I add more slides to the minimum.  I do also understand that the variable trigger must come before the state change trigger.  Now that one is successful, the challenge of working out the rest becomes an interesting problem for me.

Your patience and willingness to assist is very much appreciated!


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