advancing layers with Enter key

Sep 13, 2016

I want to move from one layer to the next using the Enter key on the keyboard, and have created triggers like this: "Show layer layer 2 when the user presses the Enter key".

This works fine for moving from the base layer to layer 2. Once I'm layer 2, using the Enter key to move to layer 3 works only if I click on the stage first. From that point on, pressing Enter toggles me back and forth between layers 2 & 3. This is despite the fact that I have a layer 4 and a layer 5, and triggers that are built to send me to incremental layers (layer 3 from layer 2, layer 4 from layer 3, etc.).

If anyone knows a fix for this, I'd like to hear about it.

Thanks...

6 Replies
Alexandros Anoyatis

Using a numeric variable will help with the redirects.

1) create a number variable (say slideProgress)
2) put a trigger on the base layer: adjust value of slideProgress to 0)
3) put a trigger on each slide layer: adjust value of slideProgress to 1,2,3,4 depending on the layer you're at.
4) remove key triggers from slide layers (yes, all of them).
5) adjust the key trigger on the base slide master to include condition "if slideProgress is equal to 0" in the Master slide.
6) duplicate the above trigger 4 times (in the base layer only), edit the layer numbers and variable values and finally reverse the order of those triggers.

It should look something like:

- Goto layer 5 when user clicks Enter and slideProgress is equal to 3
- Goto layer 4 when user clicks Enter and slideProgress is equal to 2
- Goto layer 3 when user clicks Enter and slideProgress is equal to 1
- Goto layer 2 when user clicks Enter and slideProgress is equal to 0

That should do it.

Hope this helps,
Alex

Crystal Horn

Hi there, Alex!  And thanks to Alexandros for that awesome input.

I basically did most of what Alexandros was suggesting, except I left out putting triggers on each slide layer, assuming that your layer properties will be the same as in your attachments.  Here are some shots of the variable and the triggers used...

Variable
variable

I basically want to adjust that number variable every time Enter is pressed; that way the triggers know what to do based on that variable.

Triggers
trigger

Make sure the trigger to adjust the variable comes first.  And as that variable value adds up with each Enter click, the Enter key will show the right layer (respecting the base slide triggers on each layer.

I attached your modified project so you can test for yourself.  Thanks again Alexandros for getting us off to a good start!

Crystal Horn

I get it.  It does seem odd to me that we go into an endless loop after the third layer.  I was able to reproduce that loop in another file.  My thought was that maybe the base layer was showing through somehow, and I made sure to hide other layers, including the base layer, and to prevent users from clicking on the base layer.  It made no difference, however.

It appears that the base layer trigger is still active and/or being referenced on the other layers, so the Enter key might be triggering what the base layer wants it to do-- show layer two.  That's why the conditions based on the variables work.

Another way around this is to use a different trigger on the base layer (e.g. when user clicks, when timeline ends), and then once you're on the other layers, all the Enter triggers work.  The different base layer trigger no longer interferes with the subsequent layer triggers.

That said, I don't like the mysterious secrets of the base layer trigger that we've uncovered, and I'm going to work with our QA team to see if there's another issue at play.  If it wasn't supposed to work, I wonder why it works on the second layer, at least.  We'll keep you in the loop with what we discover.

Crystal Horn

And actually, we found this discussion.  Essentially, the base layer triggers are slide triggers, so they wouldn't be disabled just because the base layer is hidden.  This user decided to use another layer, built to look like the base layer.  He set a trigger to go from the base layer to the first layer (call it Main) when the timeline begins.  I would just duplicate that base layer for the "Main" layer.  That way, you can use the Enter key trigger from the "Main" layer and beyond without issue.  See if the attached works...

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