Flex 对象克隆

package widget.EnvPlot
{

public class copyObject extends Object
    {
        public function copyObject()
        {
            super();
        }

import flash.utils.ByteArray;
        import flash.utils.getQualifiedClassName;

import flash.utils.getDefinitionByName;
        import flash.net.registerClassAlias;

public static function clone(object:Object):Object
        {

var qClassName:String=getQualifiedClassName(object);

var objectType:Class=getDefinitionByName(qClassName) as Class;

registerClassAlias(qClassName, objectType);

var copier:ByteArray=new ByteArray();

copier.writeObject(object);

copier.position=0;

return copier.readObject();

}
    }
}

上一篇:Eclipse软件使用说明


下一篇:python获取文件的内容