Conditional Variables

Feb 06, 2018

Naturally, I have an issue with my variable! I want to create what must be a typical kind of conditional variable: the user has to visit each Layer on a slide before they can move forward. Simple enough, right? So why does my variable not work? Someone-anyone, take pity on me and look at the file and let me know what I'm doing wrong.

9 Replies
Walt Hamilton


There is a problem with this trigger:


It doesn't change the variable Complete; it just sets it to what it already is.

2 things, your instinct is good. Many people set that variable when the user goes to the layer or slide, which allows them to receive credit for if, even if they immediately navigate back to the menu. Setting the variable at the end makes a lot more sense.

The other thing is that if you want them to view each layer, you need a variable for each layer. Think of program flow as an untrustworthy kid. You can't take his word for it that he has actually gone to the library to study. But if the librarian sends him home with a note that says "He was here and he studied", you can trust that. That is what a variable is. it lets the (base) menu page know that the user went to the layer. You need a note from each layer to be certain he went to each of them.

For example, here is a variable (and trigger) you might use for layer 1:



Then don't think of variables as conditional. They are messengers carrying information which is mainly useful to the conditional triggers you write. Here is the beginning of a trigger you might use on the base (menu) layer:



I only created 2 Navigation variables, but you need 8. You would need to expand the conditions out to include all 8 Navigation variables.

Any questions, just ask.


Mike Adamski

This has been helpful. I'm very close but still struggling doing the following:

I have a smart-art-looking piece that works as a click-and-reveal. I want to hide the "Next" button until all of the pieces of the smart art have been clicked. I created 8 true/false variables, and have them change from False to True upon entering that layer.

But I'm not sure how to link all of those being completed to a Next button.

Thank you!

Walt Hamilton

The trigger you need looks roughly like this:

Change state of Next to Normal when (action occurs) if Variable1 = True AND variable2 = True AND  etc.

The big question is what action you want to use to initiate the trigger, and that depends on how you have things designed.

I'm guessing the easiest might be the starting of the timeline of the layers.  I'm guessing that once revealed, each layer stays visible, and when the last is revealed, the Next button would show up. They could look at the completed piece, and when ready click Next.

Other options could be when they click to reveal, or when the layer is hidden (if they are), but the key is that each of the eight needs this trigger.

Rich Chapman

Hi there! Hope it's alright if I jump in here and ask a question too, as I'm struggling through this exactly right now: what do you recommend as a useful action to initiate the trigger? I'm jut trying to ensure that 4 buttons on a slide have all been clicked before re-enabling the Next button in the player.  Thanks! (Ashley, not Rich)

Walt Hamilton

In general terms, if the clicking shows an action (like showing a layer) on the same slide, then I use the clicking to initiate the trigger. You need a trigger on each button, and when the button is clicked, it changes next to Normal, if the state of all 4 buttons is visited.

If the clicking causes a jump to another slide, then I use the action that returns from that slide to set a variable specific to the button. Set the main slide to reset to initial condition on revisit. Then use a trigger to set Next to Normal when timeline starts if all the slides having been visited.

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