6/1/2010 2:58:20 AM
Title:
Timer
How to implement timer in Adobe AIR?
6/1/2010 4:21:04 AM
check this code example to create timer in actionscript 3.0 with Adobe AIR or Flex
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" creationComplete="init();">
<mx:Script>
<![CDATA[
private var timer:Timer;
private function init():void {
//Calls timer_function after every 1000 milliseconnds
timer = new Timer(1000);
timer.addEventListener(TimerEvent.TIMER, timer_function);
timer.start();
}
private function timer_function(evt:TimerEvent):void {
//your code to run
trace("Timer running")
}
]]>
</mx:Script>
</mx:Application>