0
我正在進行問答遊戲,涉及5個問題。我爲第一個問題做了一個計時器,所以當用戶在10秒內沒有回答這個問題時,他們會回答問題2(另一個框架)。 問題1計時器工作正常,我如何得到問題2與問題1完全相同?我試圖在問題2中添加相同的代碼,但它給了我一個錯誤。
感謝多個計時器幫助! FLASH as3
我的代碼:
stop();
var count:Number = 10;
var myTimer:Timer=new Timer(1000,2);
myTimer.addEventListener(TimerEvent.TIMER, countdown);
myTimer.start();
function countdown(event:TimerEvent):void {
count00.text=String((count)-myTimer.currentCount);
if(count00.text == "0"){
gotoAndStop(85);
}
}
myTimer.stop();
myTimer.removeEventListener(TimerEvent.TIMER, countdown);
TypeError:錯誤#1009:無法訪問空對象引用的屬性或方法。 \t在product_fla :: MainTimeline /倒計時() \t在flash.utils ::定時器/ _timerDispatch() \t在flash.utils ::定時器/蜱() – Jen 2013-03-07 12:47:05
我現在得到這個。怎麼了? – Jen 2013-03-07 12:48:06
你之前得到什麼錯誤? – M4tchB0X3r 2013-03-07 12:51:25