2016-10-13 00:16:48 点击量:8 标签: 收藏本文
[AS3]AS3.0获取系统时间的代码写法
- private function getTime():void
- {
- var timer:Timer=new Timer(1000);
- timer.addEventListener(TimerEvent.TIMER,showTimer);
- timer.start();
- }
- private function showTimer(event:TimerEvent):void
- {
- var current:Date = new Date();
- txt.text=current.fullYear.toString()+"-"+(current.month+1).toString()+"-"
+current.date.toString()+" "+current.hours.toString ()+":"
+current.minutes.toString()+":"+current.seconds.toString();- }