# \[AS2\] Multiple countdown timers to schedule indoor hockey

**URL:** <https://forum.kirupa.com/t/as2-multiple-countdown-timers-to-schedule-indoor-hockey/308960>\
**Category:** flash\
**Created:** [May 4, 2010, 6:18am UTC](https://forum.kirupa.com/t/as2-multiple-countdown-timers-to-schedule-indoor-hockey/308960 "2010-05-04T06:18:34Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![joncom](https://avatars.discourse-cdn.com/v4/letter/j/8491ac/32.png) [@joncom](https://forum.kirupa.com/u/joncom)\
**Post date:** [May 4, 2010, 6:18am UTC](https://forum.kirupa.com/t/as2-multiple-countdown-timers-to-schedule-indoor-hockey/308960/1 "2010-05-04T06:18:34Z")

</div>

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](http://www.republicofcode.com/tutorials/flash/video/countdown.php)).

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.

```auto
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. ☹
