Can't we use a variable more than once?

Aug 28, 2013

Newb to Storyline.

I just followed your "How to disable the Next button until users finish interacting with a slide" instructions and  was successfully able to keep the user locked in until the audio completed. However, I tried to use the same (as in same name) variable (true/false set to false) on an additional slide and it doesn't work. All things being equal, the only thing that would make it break is that we can't use a variable more than one time. This doesn't make sense to me. That creates a tremendous amount of extra work on long courses.

Are there any workarounds for this? Or am I missing something?

11 Replies
Phil Mayor

you would need to reset the variable to false when the next slide starts.

A variable value is independent of slides so on your second slide it is already true.

You could set a trigger on timeline start of the slide to set it to false.

Variables are a way of passing information between slides, It is probably better practice to use things like states to control the next button rather than variables, for this sort of thing it really is overkill.

You can check a variables value by adding a reference to the slide.

Michael Shannon

Thanks Phil. Now it makes sense.

So I have two choices now:

1. Add a new trigger to the start of the next slide to change the variable to false. But you say this is overkill, which I completely agree, which is what prompted my question in the first place. Remember, I was using an example posted by your team to get here.

2. Use states. Now I'm intrigued. Could you direct me to some how-tos or provide some guidance here on how this might be accomplished?

Do keep in mind that I'm using the default player buttons.

Thanks again.

Michael Shannon

After some discussions in separate areas of this forum I've come up with this solution to locking the next button:

Project Variable

A True/False variable called LockNextButton with a default value of False

Slide Master Trigger

set variable to false when timeline starts (this resets my lockNextButton so it can be used again from previous slide triggering it to true) and placed on the Master Slide

Object Trigger

set LockNextButton to equal true when media completes

Player Triggers

Jump to next slide when user clicks the next button if LockNextButton is equal to True

Show layer Oops when user clicks next button if LockNextButton is equal to False (this is an alert box to let the user know they have to listen to the audio before navigating to the next slide).

There's a previous trigger as well.

All is working as needed with one exception:

Once the user listens to the audio we want that slide to be unlocked for any subsequent viewings. As the logic is currently built the user will have to sit through the audio each time they view that slide before being able to navigate forward again. How do I create a trigger to address this? Since I have the variable reset to false on each load (since it's on the master slide) how can I create an over-ride so that once the user has listened to the media once they can freely navigate?

Michael Shannon

Here it is Ashley.

And I'll restate the challenge:

All is working as needed with one exception:

Once the user listens to the audio we want that slide to be unlocked for any subsequent viewings. As the logic is currently built the user will have to sit through the audio each time they view that slide before being able to navigate forward again. How do I create a trigger to address this? Since I have the variable reset to false on each load (since it's on the master slide) how can I create an over-ride so that once the user has listened to the media once they can freely navigate?

Jill Blaser

I don't want to be a downer here, but I've dealt with this same thing. Have you noticed that if the user clicks on the end of the seekbar in the player they can skip through the audio and still advance the slide? It may not be an issue for you depending on the project. For my project, I had to keep the user on the screen until the audio completed and the client didn't want the user to be able to skip forward using the seekbar. 

I have a thread explaining what I did here: http://community.articulate.com/forums/p/20937/193857.aspx#193857

My project still has your issue though. If the user revisits any slides they are forced to listen to the audio again. I would love to find a way to work around that, but so far I've got nothing. 

Michael Shannon

Wow Jill, that was a lot of work! Thankfully we won't have to go through that (for now), but it's nice to know that someone has blazed the trail for us if we do.

There are other tools that allow you to do this, and while it isn't always feasable to switch tools based on the criteria of the course, I think it makes sense when the added hours of development increase the cost of the project substantially. Don't get me wrong, I'm not trying to send anyone away from Articulate or Storyline, they're great products, but I think a lot of us, myself included, tend to get tunnel vision and take on a "make it work or die" type of attitude when trying to solve some of these problems.

Thanks again Jill for sharing your efforts. Hopefully we can find someone who has solved the missing piece that you and I both seek.

Anybody out there?

david mckisick

Hello MIchael. I recently created a course with a similar issue that I had to address. Our customer wanted the users to sit through each and every slide of the course, but I was able to persuade them to allow free navigation after they completed the course. To make all this happen I first created a variable called 'NextAdvance' set to False. I adjust this variable to True at timeline end. I then set the condition on each and every NEXT trigger to only advance if NextAdvance = True. At all slides after #1 I then set NextAdvance = False at timeline start, and then copy in the trigger to adjust it to False at timeline end, along with the conditional trigger on the NEXT button.To open up free navigation after a user has completed the whole course, I created a new variable called 'CourseDone', set to False. I adjust this variable to True at the Results slide timeline start. I then had to go back to each and every slide and add an OR condition to the NEXT button for this. So, the NEXT button trigger now has two conditions - NextAdvance = True, OR CourseDone = True.

This will not work on Master Slides. It's a lot of work, but in the end it does work. I suspect you can do the same as this with media as well. Just create a trigger to associate with the playing of the media files and adjust as necessary to get what you want. Again, this will probably not work with Master slides. You will need to adjust your variables on each and every individual slide.

This is a lot of work and can get very confusing when you have a lot of variables in your course, so what I do to make things easier in keeping track of variable states is insert references into the slides that are using variables heavily and on Preview, I can see the states change and then make adjustments as necessary to ensure the variable states are behaving as I want them to.

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