Multiple Countdown Timers link to Triggers

Sep 08, 2015

Hi Forum,

I have two slides.  First slide has buttons.  I want the second slide to have timers, that commence counting down when the buttons on the first slide are clicked.

I'm fairly good with variables.  How can I say "start at 100 seconds and count down once the button is clicked"?

Thanks.

11 Replies
Simon Wood

Matthew - thanks for this response, I was hoping there'd be a coded solution.  I'm creating the "3 Switches 3 Bulbs" problem to teach "thinking outside of the box".

It's important that they can turn off the light switch in room 1, and walk into room 2 and see that the bulb is still cooling down (even though it's been switched off).

I'm trying to think of different ways to implement this, and one is to have the bulbs temperature displayed (perhaps when they hover the cursor over the bulb).  Another could be to have the bulb or filament glow dull for 10 seconds (that's easier to implement).  Either way I need to use a timer of sorts.

With my project - the "multiple clicks speed up the timer" will be a problem, I might try to re-code it or find a workaround.

Any more clues?

PS - any way to "stop" the Java execution with a different trigger?  That would be an easy solution - because the user have to turn the switch OFF before they can turn it back ON again (and re-activate the script).

Alexandros Anoyatis
Matthew Bibby
The downside of this code is that if the button is pressed multiple times it speeds up the timer. Hopefully someone has a better approach that works around this issue. 

 

To work around this, you should create an additional "t/f" variable (say "counterActive") and use it as a condition to execute the JS only once.

Alexandros Anoyatis
Simon Wood

I'm trying to think of different ways to implement this, and one is to have the bulbs temperature displayed (perhaps when they hover the cursor over the bulb).  Another could be to have the bulb or filament glow dull for 10 seconds (that's easier to implement).  Either way I need to use a timer of sorts.

 

Ok, the JS included in this post might help you to leverage the temperatures as you wish. You'll probably need to adjust the timings of the variable increase/decrease to be slower, but the functionality you seek is already there (not sure if the demo link still works, but the source is included).

Hope this helps,
Alex

Simon Wood
Matthew Bibby

 

Okay, it is starting to make a bit more sense now.

Would something like this work?

See the attached story file to understand how it is set up...  

 

Yes - that's a simple/elegant solution (making use of the entrance animation).  I can't see a way for it to work on multiple slides though (with the bulbs on the second slide).  See my story project file above ^.

Simon Wood

Matthew!

Got it!  I was able to manipulate your example to make it work.  Essentially the trick is using entrance animation to time the cool-down (rather than trying to implement an actual timer).

Naturally - variables allowed me to work across slides.

It's not perfect (when you open the second slide with bulbs, any that were "recently switched off" will cool down together in sync - instead of cooling down X number of seconds after they were turned off).  Would be great to figure out how to achieve that.  I guess I could add multiple sectional variables for each bulb (splitting the animation-timer into four parts).

Will post final product when complete.

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