Advertisement |
AS3: Basic Timer example
Flash's Timer Class requires two parameters. The first is the delay (in milliseconds), the second is the amount of times you want the delay to fire.
var timer:Timer = new Timer(1000, 2); timer.addEventListener(TimerEvent.TIMER, blah); timer.start(); function blah(e:TimerEvent):void{ trace("Times Fired: " + e.currentTarget.currentCount); trace("Time Delayed: " + e.currentTarget.delay); }
0 comments: