Can't toggle a single button between states?

Jun 05, 2023

I'm trying to set up a single button that toggles between "unclicked" and "clicked" states, or changes a "ButtonClicked" variable between true and false, but can't seem to do it.

It seems like when the button is clicked once, it sets the state to clicked (as desired), then SL goes down the trigger list and sees the changed state (clicked) and then the trigger that is meant to set it back when it's clicked the next time (in clicked state) sets it back instantly, even though it's only been clicked once.  

Is this what's going on, and if so, how do you recommend setting up buttons that toggle states, or variables?

Thanks so much!  Attached is a simple test - you'll find it in the Master Slide.

10 Replies
Bert Snow

I'm working on this and still failing.

My buttons will be on a Master Slide, so I've figured out to change variables and have variable listeners to turn things on and off.

But the button-state seems to change, then immediately change back when the jump to the appropriate slide happens.  Attachment shows simple test case.  Your help appreciated! 

Judy Nollet

As Walt said, it's best to upload a .story file for troubleshooting. (And, when you want to show how something looks when published, it's best to publish it to Review and provide the link.)

Based on your description, I'd say the button is working as expected. When you jump to a slide for the first time, it starts from scratch (that is, the equivalent of "Reset to initial state"). So the button is reverted to its initial state, which is Normal. 

Since you want the button on the Master, you need to handle it a bit differently, as shown in the attached demo.

  • Button trigger toggles the T/F variable (as described in my original comment). 
  • Another trigger on the Master changes the state of the button to Selected when the timeline starts, with the condition that the variable = True. This keeps the Selected button in that state when the user jumps to a new slide.
Judy Nollet

FYI: It you have another issue, it's best to start a new discussion. That will help others when they're searching for answers.

It's also a good idea, because someone who answers a given post won't necessarily return to it. (Yeah, you can put "@" in front of someone's name. But that doesn't actually tag them in the way it would on other social media sites. A person has to "subscribe" to a post to get notified about it.)

Judy Nollet

Thanks, Bert, for the inspiration. I figured others might have a similar situation, so I posted a tip about this topic: TIP: Master Toggling On and Off - Articulate Storyline Discussions - E-Learning Heroes

  • It includes an updated demo file with some extra triggers to ensure the button will appear in the correct state no matter how the Slide Properties are set for revisiting.
  • That demo also includes an example of how to use the T/F variable to control an object on the slide.