当前位置: 代码迷 >> Web前端 >> Timer的例证
  详细解决方案

Timer的例证

热度:278   发布时间:2012-10-28 09:54:44.0
Timer的例子
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" minWidth="955" minHeight="600" creationComplete="TimerInit();">
	<mx:Script>
		<![CDATA[
			import flash.utils.Timer;
			import flash.events.TimerEvent;
			private var num:int = 0;
			private function TimerInit():void{
				var timer:Timer = new Timer(1000);
				timer.addEventListener(TimerEvent.TIMER,onTTimer);
				timer.start();
			}
			
			private function onTTimer(event:TimerEvent):void{
				
				label1.text=num.toString();
				num++;
			}
			
		]]>
	</mx:Script>
	<mx:Label id="label1" x="200" y="200" fontSize="24" fontFamily="Arial"/>
</mx:Application>
?
  相关解决方案