我有一组movieclip类
var array:Array = new Array(MovieClip1, MovieClip2, MovieClip3);
然后我想创建它们的新实例。类似的东西:
var o:MovieClip = new array[0];
有没有办法做那样的事情?
答案 0 :(得分:1)
如果MovieClip1,MovieClip2是String,那么试试,
var array:Array = new Array(MovieClip1, MovieClip2, MovieClip3);
var o:MovieClip = new ( getDefinitionByName(array[0]) as Class);