Variables and Layers

Aug 01, 2014

Hello everyone!
I am working on a page with 6 layers (base layer + other 5 layers).

I need to set a rule that allows the user to click the next button *ONLY* if he opened all the layers.

Next/Previous buttons are custom-made (copy&paste the button + trigger added).

Can you help me?
I'm not good in creating variables... :(

Thank you!

21 Replies
Fanny Virgilio

Hi Mary,

You don't need to use variables. Kamil gaves you the solution.

In general, I add a layer that appears when you click on NEXT and all other layers were not seen. I put an instruction "Click all buttons before continuing." In this way, the user does not have the impression that the NEXT button does not work.

Sorry for my english, I'm french

Brian Allen

Similar question in another thread, and similar solutions provided.

Using the "visited" state of the buttons is definitely an option.

If you wanted to use variables, just create a variable (default value of False) for each layer that needs to be viewed. Add a trigger to each layer that sets the value of that layer's variable to True.

Add conditions to the trigger of your next button that all variables have to equal True before the user can go to the next slide.

Additionally, using either method, it would be nice to add a layer that would display if the user has not viewed all of the slides, letting them know that they need to before they move on.

Brian Allen

Mary Lain said:

How can I add the condition "if all the buttons are visited"?
I cannot find it anywhere.

Sorry and thank you!

^_^

Hi Mary,

Using the visited state or variables will require you to add multiple conditions. For example, the state of this button is visited, AND the state of this other button is visited, etc. Alternatively, with variables, it would be variable 1 equals True, AND variable 2 equals True, etc.

Here is a tutorial on using variables - http://community.articulate.com/tutorials/products/adding-true-false-variables.aspx

Chris Fletcher

If you use your own buttons, set the state of your next button as "disabled". Then create a trigger like this:

Action - Change State Of

On Object - Next Button

To state: Normal

When: State

On: All of - then tick all of the buttons that open the layers

Is: Visited

That should do it. The Next button wont work until they've all been viewed.

Chris

Mary Lain

Thank you Chris!
I am trying to use your solution (seems to be the easiest), however, I don't understand if I have to add that trigger on every layer or not.

I followed your instructions and the condition works on the base layer only.

When you click a tab and open a layer, next button sets on normal.

Am I doing something wrong?

Thank you!

Ashley Terwilliger-Pollard

Hi Mary,

Are all the buttons to your layers from the base layer or on each individual slide layer? If the buttons are also on the layers themselves and just not accessible from the base layer - you'll also need to add the trigger to the layers themselves...but it would be a lot less work to show your base layer, and only hide particular elements you want to hide using the "eye" icon within the timeline:

Please feel free to let us know and if you'd like to share that one slide from your .story file we're happy to take a look!

Katherine Redfern

Hi - I am trying to do this and failing. I have six buttons that need to be clicked on, and a next button that needs to appear once all the buttons have been clicked on. Tried both a visited state on the six buttons, then variables on the layers they open, but my next button still won't appear.

Can anyone help?

Katherine Redfern

Hi Wendy - thanks so much! Your solution worked perfectly. I had set my 'next' button to appear when all of the buttons had been visited, but had the trigger set to do this when the timeline started rather.

The thinking behind my  setup was that at the point after the timeline started and all the buttons had been visited the next button would appear.

Would you be able to explain why this didn't work? This would help with my understanding of the logic behind SL.

Thanks again!

 

 

 

 

Wendy Farmer

Hi Katherine

This is how I think of it and I may be way off base - When you click button 6 and the layer appears / then you close the layer you haven't actually restarted the slide timeline. You are on the base layer and have made a popup show/hide.

I find variables a much easier way to control what is happening.  I always put my variable on the slide %allvisit% when I am testing so I can see exactly when the variable changes so I can make sure the triggers work.  Trigger order is also important.

Here is a link to some info on how triggers are executed

https://en-au.articulate.com/support/storyline-2/the-order-in-which-triggers-are-executed-in-articulate-storyline-sl2

Sorry I couldn't explain it better.