Toggle switch to show layers act funny

I use toggle switches a lot: 'Set SomeTrueFalseVariable to NOT'. I use them to trigger animations and sounds on the master slide or to fire other variable adjustmens across layers. I set them to fire when SomeTrueFalseVariable changes, regardless of its value. It makes for lightweight courses.

They work like a charm EXCEPT in this case: 

I have 4 layers, layer 1 is shown at start of slide

I have two buttons on the base layer, button UP and button Down. 

When clicked, they toggle a variable.

When variable Up is triggered, a trigger on layer 1 shows layer 2 and closes layer 1.

When Down is triggered, layer 4 is shown and layer 1 closes.

I have triggers like these on all 4 layers, opening the next, closing itself.

The point is to let the learner browse through different options, without having to duplicate buttons on all layers. 

It doesn't work. When the toggle fires, strange things happen.

I know I can accomplish the same thing using different methods. But I am curious as to why it won't work! Is this a bug? Am I overlooking something?



2 Replies
Annie Jean

Hi Ayoub,

I am no professionnal at this but there is one thing I have understood using Storyline...

There is no "live listener" for the variable so they are looked at only when an action takes place.

When using variables I make sure that the trigger involving it as an action into the "When" field.

For an example, using a True/False variable : Show layer 2 When user cliks "blue button" If Variable 2 = True

In your trigger, you use "When variable changes", I have never been able to make it work and from the beginning, I have always been told by the Guru to use an action. Maybe someone who is more advanced in variable use will kick in this discussion and give you more information that I can.

Hope it helps and have a nice day!


Job Vlaming

Hi Annie, 

Thanks for your reply!

I must disagree, though. Storyline does indeed listen for changing variables. I use the 'when variable changes' all the time. With and without conditions. They work perfectly most of the time.

It's great for using sound effects and animations that re-occur throughout the course. I only have to program them once, on the base layer. 

The only issue is the one I mentioned. I think this is what's happening.

Layer 1 is open from start

Learner clicks button on base layer, firing toggle switch.

Trigger on layer 1 opens layer 2, closes layer 1

Trigger on layer 2 opens layer 3, closes layer 2

Trigger on layer 3 opens layer 4, closes layer 3

Trigger on layer 4 opens layer 1, closes layer 4

The program then gets stuck in a loop, resulting in erratic behaviour.

It seems the variable is set to 'changing' all through this cascade, where I would expect it to only be applied to the layer that is open at the time it fires.