# Help with Variables

HELP!!! I have a project due tomorrow morning. In the course I have a slide that uses variables to show a series of layers as the user clicks the NEXT button in the player. The variable essentially adds "1" to the count each time the NEXT button is clicked. When it reaches a set number it allows the NEXT button to advance to the next slide. What I need to do is add a variable to that so the count is reset to "0" when it advances to the next slide. If anyone can help me with this, PLEASE post your answers NOW. As you can tell, I am between a rock and a hard place with this. I know it is probably a simple thing and someone has already posted the answer but I don't have time to search

Thanks all!

Here is a screen shot of my triggers. The last trigger, Jump to Next Slide, is where I want to add a variable to reset the count to "0"

###### 8 Replies

Add a slide trigger to the NEXT slide that sets the variable to 0 when the slide's timeline starts.

I'm a novice with variables, can you give example? Demanding, aren't I?

I would add the trigger to the top of the list on the beginning of the slide.  You need to add

When Slide timeline begins

Set LayerOne is equal to 0.

The reason for this is because if you add it to the very end, it will go the the Next Slide before executing the trigger to reset your code. So it will still equal 9

If you try to put it before the trigger goes to the next slide, then it will never go to the next slide because LayerOne will equal 0.

So you have to reset the variable at the beginning of the slide.

The execution of the triggers is linear. Meaning they execute in the order that they appear. So if you have a trigger in the middle that goes to another slide, then it will never execute what comes after.

Michael, I THINK I got it! See below.

Many, Many, Many, Etc...... Thanks!

Jerson,

Wouldn't that be When timeline ends set layerone to 0?

Edward Springer said:

Michael, I THINK I got it! See below.

Many, Many, Many, Etc...... Thanks!

That's what I had in mind. One more thing: In your original post, the second trigger from the top jumps to the next slide when the next button is clicked and your variable is 1. Should this trigger not show some layer?

Michael, I think you just uncevered one reason why the slide was not functioning correctly. That trigger should be Show Layer, not Jump to next slide. I fixed it and, along with your reset variable, it seems to be working as desired. There are none so blind that cannot see. Again to you, Jerson, and everyone in the Articulate Community, Many thanks for the support. Hoepfully, one day I'll have the ability to pay it forward.