定时器没有在文本标签中显示倒计时,为什么?

时间:2011-03-27 01:13:26

标签: actionscript-3

计时器代码:

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;
}

当我运行我得到的动画片段时,定时器应该显示倒计时,而是“[对象定时器]”消息。有谁知道为什么?

1 个答案:

答案 0 :(得分:1)

function timerListener (event:TimerEvent):void {
    secs.text.text = oneSecTimer.currentCount;

}

罗布