Timer class updated
Friday 14 May 2004 – Filed under: Flash – No Comments
I’ve updated my previously posted Timer class. It has been extended with (a slightly modified version of) Design Nation’s Callback class to allow for executing a callback function when the timer is ready. I’ve also made some changes to the events broadcasted by the Timer class.
To use this class, simply download the source files and place both classes (Timer.as and Callback.as) in the correct package folder (mine is “com/mdv/”) in your Flash MX 2004 classpath. The download includes some documentation, which you can also read online.
The code below creates a timer that runs 3 loops of 2 seconds each:
import com.mdv.Timer; var myTimer:Timer = new Timer(2000, 3);
This sample code uses the new callback extension:
import com.mdv.Timer;
myTimer:Timer = new Timer(1000, 2, { context:this, method:"onTimerReady" } );
myTimer.start();
Don’t forget the online sample.
« previously: Hello invaders! next: Macromedia’s ASDoc »
Leave a Reply
Recent Articles
- Running Google Chrome OS under Parallels
- AS3 Tweetr library suffers from the Twitpocalypse bug
- Digital TV on Mac Mini, part 2
- Digital TV on Mac Mini, part 1
- New bike
- FLV Player 2.0.25 released
- No custom headers for Flash file upload. Why?
- Building AIR with FDT
Advertisement
Categories
- Art & Design (4)
- Flash (38)
- FLV Player (9)
- Software (17)
- User Experience Design (3)
- Various (10)
- Work (6)