【发布时间】:2011-10-13 00:24:57
【问题描述】:
我正在尝试在舞台中生成多个星星,但我不断收到动作脚本错误。
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()
在全局/运行时::ADLEntry()
提前致谢。
【问题讨论】:
标签: flash actionscript-3 movie flash-cs5 clip