Using Variables to Change Button States

Oct 16, 2023

I had an issue today, and although I solved it, I was wondering if there was someone who could do so using a less cumbersome method.

Essentially, it was using variables to change the state on a base slide.

What I wanted to do was hide a button at the beginning of the timeline of the slide, and then, when a T/F variable was triggered, change that button to normal. The change of the variable occurred on another slide, but I didn't think that mattered - after all, variables are supposed to work throughout the project (and most of the time, mine do).

What I ended up doing was using layers as buttons, so that a layer was revealed when the variable was triggered. Like I said, this was/is super cumbersome, and although the set-up works, and I've got what I want, it seems like I'm missing something here.

So I would be extremely grateful if someone could take a look at the file and let me know what they think! Thank you!

3 Replies
Walt Hamilton

You are correct in saying that variables hold their values throughout the project. But you are relying on initiating a trigger when a variable is changed. Variables announce a change only to the slide on which they change. It does make sense. Only the current slide is functioning, and you don’t want every “when variable changes” trigger in the whole project firing each time a variable changes.

So if a variable changes on one slide, then you return to a different slide, it will not know that the variable has changed. The best way to handle that is to write your triggers to initiate “when  the slide timeline starts if the variable equals True” (or False, as the case may be). Whether you have return to slide to set to initial or saved condition, the timeline restarts, so that trigger will execute.