0
這是我收到的錯誤。我只是把我所有的代碼轉換成類。時間線和課程之間變得非常複雜。我有一個名爲「PopUpItem」的鏈接屬性的MovieClip,每次該類被激活時,一個Item出現在屏幕上3秒鐘,然後移向清單。當它在時間軸上時,我已經工作了,但現在不再了。有什麼建議麼?錯誤與計時器類
[SWF] VQuest%20V2.swf - 減壓 未定義 在flash.utils ::定時器() 在PopUpItem()[PopUpItem :: PopUpItem:2]之後2955884字節
package {
import flash.utils.Timer;
import flash.display.MovieClip;
import flash.events.MouseEvent;
import flash.events.TimerEvent;
import flash.events.Event;
public class PopUpItem extends MovieClip {
var popUpTimer: Timer = new Timer(1000, 3); // 3 seconds
var popUpItem: MovieClip = new PopUpItem;
var i = 0;
public function popUpFunction() {
popUpTimer.addEventListener(TimerEvent.TIMER_COMPLETE, onComplete);
}
public function itemReceived(received) {
for (i = 0; i < 1; i++) {
addChild(popUpItem);
popUpItem.popUpAnimation.gotoAndStop(received);
popUpItem.x = 400;
popUpItem.y = 250;
popUpItem.itemText.text = "You got a " + received + "."
popUpTimer.start();
popUpItem.play();
}
}
public function onComplete(event: TimerEvent): void {
removeChild(popUpItem);
i = 0;
}
}
}
是的,它曾經在MainTimeline上。我用「this」取代了整個變量,所以至少現在遊戲沒有這個錯誤。非常感謝。 – Apf42589