我的目标是在我的舞台上加载多个(动画)对象,作为一个电影剪辑 trought 一个数组。
我当前的代码:
var vijand:Array;
vijand = new Array ;
vijand.push(new Vijand(-580,-200));
vijand.push(new Vijand(-500,-200));
vijand.push(new Vijand(-420,-200));
for (var n:int = 0; n < vijand.length; n++)
{
this.addChild(vijand[n]);
}
//not working part. They do load on my stage. But I cant control the animation within the file(its a .SWF file I load)
for (var n:int = 0; n < vijand; n++){
gotoAndStop(1)
}
所以基本上我的问题是我怎样才能让所有这些用“gotoAndStop(1)”和/或“gotoAndStop(2)”来做动画,依此类推。
编辑:在代码中加载它的外部文件
public function Vijand(positieX:int, positieY:int)
{
vijand = new Loader();
vijand.load(new URLRequest("resources/vijand.swf"))
this.addChild(vijand);
vijand.x = positieX;
vijand.y = positieY;
}