计时器代码:
var oneSecTimer:Timer = new Timer (1000,60);
oneSecTimer.start();
oneSecTimer.addEventListener(TimerEvent.TIMER , timerListener );
oneSecTimer.addEventListener(TimerEvent.TIMER_COMPLETE , onTimerComplete );
function timerListener (event:TimerEvent):void {
secs.text.text = oneSecTimer;
}
function onTimerComplete (event:TimerEvent):void {
gotoAndStop(5);
days=days+1;
}
当我运行我得到的动画片段时,定时器应该显示倒计时,而是“[对象定时器]”消息。有谁知道为什么?
答案 0 :(得分:1)
function timerListener (event:TimerEvent):void {
secs.text.text = oneSecTimer.currentCount;
}
罗布