movieclip类的数组

时间:2013-12-16 18:12:52

标签: arrays actionscript-3 flash movieclip

我有一组movieclip类

var array:Array = new Array(MovieClip1, MovieClip2, MovieClip3);

然后我想创建它们的新实例。类似的东西:

var o:MovieClip = new array[0];

有没有办法做那样的事情?

1 个答案:

答案 0 :(得分:1)

如果MovieClip1,MovieClip2是String,那么试试,

var array:Array = new Array(MovieClip1, MovieClip2, MovieClip3);

var o:MovieClip = new ( getDefinitionByName(array[0]) as Class);