Posted by sortofme on October 16th, 2008
Actionscript:
-
// We need to import the utils package
-
import flash.utils.*;
-
-
// Create a new Timer object with a delay of 500 ms
-
var myTimer:Timer = new Timer(500);
-
myTimer.addEventListener( TimerEvent.TIMER, timedFunction);
-
-
// Start the timer
-
myTimer.start();
-
-
// Function will be called every 500 milliseconds
-
function timedFunction(eventArgs:TimerEvent){
-
trace(”Timer fired ” + myTimer.currentCount + ” times.”);
-
}
Recent Comments