我对动作脚本还没什么经验,但我在论坛上搜索了很多,试图找到解决这个简单问题的方法。
我正在制作一部电影的几个副本,但我需要它们有不同的名字。
// this array gets several cities
var cities:Array = new Array(
{ nome:"london", pos_x:20, pos_y:10 },
{ nome:"nyc", pos_x:210, pos_y:210 }
);
// now i would loop the cities array and create a copy of city_img for each
var k:*;
for each (k in cities) {
var mov:city_img = new city_img(); // city_img is a movieclip
addChild(mov);
mov.x = k.pos_x;
mov.y = k.pos_y;
mov.id = i;
i++;
}
这个代码可以工作,但是,正如预期的那样,
mov
id=1
. 即使舞台上画了两部电影。
有人能帮我吗
指定不同的名称
每一部电影的口吻?