AS3 根据实例名称复制元件

import flash.utils.getDefinitionByName;
import flash.utils.getQualifiedClassName;

/*var ClassRef: Class = getDefinitionByName(getQualifiedClassName(gameMc)) as Class;
var clone_mc: DisplayObject = new ClassRef();
this.addChild(clone_mc);*/

var ClassRef: Class = gameMc.constructor;
var clone_mc: MovieClip = new ClassRef();
addChild(clone_mc);

二选一

  

上一篇:ORACLE中的KEEP()使用方法


下一篇:.net 5 上传文件到阿里云的OSS