1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
|
<?xml version="1.0" encoding="utf-8"?>
<mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml" width="1130" height="732" creationComplete="onInit()">
<mx:Script>
<![CDATA[
import flash.utils.Timer;
import mx.controls.Alert;
var mTimer:Timer
private function onInit():void
{
mTimer = new Timer(1000,5);//ticks for 5 secs
mTimer.addEventListener(TimerEvent.TIMER,Countsec);
mTimer.addEventListener(TimerEvent.TIMER_COMPLETE,Comple);
mTimer.start();
}
private function Countsec(e:TimerEvent):void
{
lbltime.text=e.target.currentCount;
}
private function Comple(e:TimerEvent):void
{
lbltime.text="Time Complete";
}
]]>
</mx:Script>
<mx:Label id="lbltime" x="374" y="167" width="369" height="61" fontWeight="bold" fontSize="30"/>
</mx:Canvas> |
Partager