我做了“3.0行动”编程,我非常清楚这一点。我有一个与“2.0行动”有关的项目,我有一个在舞台上添加实例的简单问题。在“3.0行动”中,我想在一些电影剪辑中添加多个实例,首先将它们保存在一个阵列中,然后我与该阵列一起设定 X和Y,宽度、阿尔法和其他细节。
例如:
" itemBlock
" 是我的实例,是图书馆导出的一个电影剪贴片。
for ( var i = 0 ; i < 24 ; i++ ) {
blockBANK[i] = new itemBlock(); // itemBlock is an exported movieclip in the library.
blockBANK[i].x = // some calculation;
blockBANK[i].y = // some other calculation;
mainPage_mc.addChild(blockBANK[i]); // add to the mainPage_mc holder
}
and now I can use this array to add and edit my instance everywhere in my AS3 code. In AS2 I try these but not working and also NO compiler error !
for (var i=0;i<7;i++) {
var temp:MovieClip = new MovieClip();
temp.attachMovie("itemBlock "," itemBlock "+i,0);
textboxBANK[i].addChild(temp);
textboxBANK[i]._y = 40;
textboxBANK[i]._x = i * 20;
mainPage_mc.addChild(textboxBANK[i]);// add to holder
}
没有工作,没有编译器错误
for (var i=0;i<7;i++) {
var temp:MovieClip = new MovieClip();
temp.attachMovie("itemBlock","itemBlock"+i,0);
textboxBANK[i].attachMovie(temp);
textboxBANK[i]._y = 40;
textboxBANK[i]._x = i * 20;
mainPage_mc.attachMovie(textboxBANK[i]);// add to holder
}
没有再次工作,也没有编译器错误..
我如何将实例放入一个数组, 并将其 < 坚固 > 添加 < / 坚固 > 给AS2 中的数组的持有者 < 坚固 > FROM < /坚固 >?