[AS2] Multiple countdown timers to schedule indoor hockey

Hello and thanks for taking the the time to offer your advice. I’ve successfully made a countdown timer countdown to a predefined date (Christmas, and yes it was a tutorial).

The program I aim to create here will run a series of countdowns, all day long, one after the other, basically counting down to the next event.

For example:

1 minute countdown til game begins
20 minute countdown til intermission
2 minute countdown til second half
20 minute coundown til games over
5 minute countdown til new game starts

I have been given a lists of times for which to begin each timer (and its duration), but the tutorial I followed earlier uses an onEnterFrame function.

I need some way to determine the closest timer that should be running, without killing the CPU with onEnterFrame. This task seems like it should be simple, but I can’t quite wrap my head around it.

Please help!

Here’s a basic idea of the array holding the start of the timers and its duration.

var timers:Array = new Array(
							   
["6:29AM","1"], // One min warning
["6:30AM","18"], // First
["6:48AM","2"], // Intermission
["6:50AM","18"], // Second
["7:08AM","6"], // Count til next game

["7:14AM","1"],
["7:15AM","18"],
["7:33AM","2"],
["7:35AM","18"],
["7:53AM","7"]

)

I think I just need a push in the right direction… as my mind has gone blank. :frowning: