我试图在舞台上生成多个星星,但我不断收到动作脚本错误。
stop();
var i;
var arrayStars:Array;
for(i=0; i<70; i++) {
arrayStars[i] = new Star(); //Star is a linked movie clip exported to AS3.
arrayStars[i].x = Math.floor(Math.random() * 1650);
arrayStars[i].y = Math.floor(Math.random() * 1060);
addChild(arrayStars[i]);
}
我得到的错误是:
TypeError:错误 #1009:无法访问空对象引用的属性或方法。
在 Untitled_fla::MainTimeline/frame1()[Untitled_fla.MainTimeline::frame1:7]
在运行时::ContentPlayer/loadInitialContent()
在运行时::ContentPlayer/playRawContent()
在运行时::ContentPlayer/playContent()
在运行时:: AppRunner/run()
在 global/runtime::ADLEntry()
提前致谢。