Packageorg.as3lib.utils
Classpublic class Cloner



Public Methods
 MethodDefined by
  
clone(source:Object):*
[static] Creates a duplicate of the source object by storing it in a ByteArray and reading it back in, The object will return untyped so you may need to cast it to the desired class.
Cloner
Method detail
clone()method
public static function clone(source:Object):*

Creates a duplicate of the source object by storing it in a ByteArray and reading it back in, The object will return untyped so you may need to cast it to the desired class. To ensure your object retains its type, you should register the class using flash.net.registerClassAlias() before cloning. AMF rules apply. Check out the documentation for more info.

Parameters
source:Object — - the object to duplicate.

Returns
* — - the duplicate of the source object.

See also

flash.net.registerClassAlias()

Example
        registerClassAlias("com.example.Example", Example);
        var example:Example = new Example();
        var clone:Example = Cloner.clone(example) as Example;