Timer class
Timer is a simple ActionScript 2 class that enables you to create timers for whatever purpose. I’ve been using this class in my own projects quite a lot, and I thought it might come in handy, so it is now available for download and suggestions.
To use this class, simply download the source files, place it in the correct folder (mine is “com/mdv/”) in your Flash MX 2004 classpath and you’re ready to go. The download includes some documentation, which you can also read online.
Then, use the code below to create, for example, a timer that runs 3 loops of 2 seconds each:
[as]import com.mdv.Timer;
var myTimer:Timer = new Timer(2000, 3);[/as]
C’est tout. There are a lot of events broadcasted by the Timer class, please refer to them in the documentation.
I’ve also created an example .swf.
