-1
我需要这两个项目在我的数组中显示在舞台上。现在这些都是数组中的所有项目。问题是如何将这2个对象添加到使用数组的阶段?将addChild()添加到arryas actionscript 3
for (var b:int = 0; b < csa.length; b++)
{
addChild(csa[1]);
addChild(csa[2]);
csa[1].x = 27;
csa[1].y = 214;
csa[2].x = 9;
csa[2].y = 833;
}
当前与此它给我这个错误
:
TypeError: Error #2007: Parameter child must be non-null. at flash.display::DisplayObjectContainer/addChild() at SkoolBook_fla::MainTimeline/frame26()[SkoolBook_fla.MainTimeline::frame26:10]
heeh yah我仍然试图了解编程结构:p但是这些原本是我需要访问的选择。这是我知道的唯一方法。你可以告诉我没有循环的其他方式 – tailedmouse 2013-02-13 07:27:45
当你直接使用'csa [0]','csa [1]'时,你不需要循环。你没有使用循环索引'b'。如果你使用循环,那么你应该使用'csa [b]'而不是直接在循环中访问这两个元素。 – taskinoor 2013-02-13 07:31:28
哦,我看到非常感谢你..我做到了,而不是:D – tailedmouse 2013-02-13 07:32:49