how to reset a number variable to 0
Nov 16, 2012
By
Andrew Evans
Hi
Small problem...hopefully.
I have a number variable that is counting the instances of objects being dropped on a hotspot.
I have set triggers to activate on 2 and 4 and 6. This works fine. However if a second user undertakes the training or same user has a second go at the slide the number variable continues to increment upwards eg 7, 8 9 as more objects are dropped.
I therefore want to reset the number variable to 1 every time it is greater than or equal to 7 and to .
Any ideas guys??
7 Replies
Hi Andrew
Welcome to the community
it is posible to add conditions to triggers and therefore additional logic.
Just look at the example hereafter...
2. Click on the show conditions
3. Click on the green "+" sign
Here you can add your logic, like if my variable = 7 then my variable = 0...
Hope it helps
Geert
certainly does
done!
thanks
I have a slide with a number variable that holds a score. I want to reset the number variable to 0 when the slide is revisited. Can this be done?
Hi Dana
Set a trigger:
adjust variable 'score' assignment = 0 when timeline starts on the slide.
Make sure it is the first trigger in the panel or above any other trigger that sets that variable.
Hi Wendy,
Thanks for your suggestion. I tried it , but the variable didn't change when the timeline started upon revisiting. The same score displayed.
I may not have described the situation clearly.
When you create an "adjust variable" trigger, you are only given the option to add, subtract, or divide but not to reset the number variable (erase the current value it is holding and start back to 0)
Danita
Hi Danita,
If I'm understanding things correctly, I think what you'd need to do is create the variable with the =Assignment operator, like it shows below.
Then you'll just set the Value to 0 so it looks like this. I think this is what Dana was getting at.
Is that what you are looking for?
Hope this helps.
Tracy
Wendy, Tracy,
Thank you so much! It worked.
Dana
This discussion is closed. You can start a new discussion or contact Articulate Support.