當我嘗試使推土機出現在舞臺上時,出現上述錯誤代碼。這讓我瘋狂,我不知道爲什麼會發生。我的圖書館裏有推土機剪輯,它似乎被正確定義。任何幫助將不勝感激。AS3錯誤#2007:參數子項必須爲非空
import flash.display.MovieClip;
import flash.events.MouseEvent;
import flash.ui.Mouse;
//START SCREEN
var startScreen: MovieClip;
var bulldozer: MovieClip;
startClick.addEventListener(MouseEvent.CLICK, startGame);
function startGame(event: MouseEvent): void {
startScreen.parent.removeChild(startScreen);
startClick.parent.removeChild(startClick);
addChild(bulldozer);
var enemyGenerator: Number = Math.random();
if (enemyGenerator >= 0.8) {
bulldozer.x = stage.x = 150;
bulldozer.y = stage.y = 150;
} else if (enemyGenerator >= 0.6) {
bulldozer.x = stage.x = 250;
bulldozer.y = stage.y = 250;
} else if (enemyGenerator >= 0.4) {
bulldozer.x = stage.x = 350;
bulldozer.y = stage.y = 350;
} else if (enemyGenerator >= 0.2) {
bulldozer.x = stage.x = 400;
bulldozer.y = stage.y = 400;
} else {
bulldozer.x = stage.x = 450;
bulldozer.y = stage.y = 450;
}
startClick.removeEventListener(MouseEvent.CLICK, startGame);
}
另外:什麼是startClick?另外:當你的問題涉及錯誤時,請發佈完整的錯誤。 – FlavorScape