请帮忙!我不知道为什么我的计时器在循环数后没有停止。我在开头声明了一个变量“roundCount”。Timer 应该在它的值为零时停止,对吧?但它不断递减“roundCount”的值 3,2,1,0,-1,-2,-3 等。
var roundLength:uint = 1000;
var roundCount:uint = 0;
con_btn.addEventListener(MouseEvent.CLICK, conPoint);
function conPoint(m:MouseEvent)
{
if (cB.height == 60)
{
conductSigns.conductMasker.y = 27;
roundCount = 10;
penaltyTimer.start();
}
}
var penaltyTimer:Timer = new Timer(roundLength,roundCount);
penaltyTimer.addEventListener(TimerEvent.TIMER, countDown);
function countDown(t:TimerEvent):void
{
timeOut_txt.text = String(roundCount - penaltyTimer.currentCount);
}