//**************************************************************************** //Copyright (C) 2004 Macromedia, Inc. All Rights Reserved. //The following is Sample Code and is subject to all restrictions on //such code as contained in the End User License Agreement accompanying //this product. //**************************************************************************** /** Static class with methods for performing copies of in memory objects including nested properites arrays etc. */ class mx.utils.ObjectCopy { public static function copy( refObj:Object ):Object { var result:Object = new Function( refObj.__proto__.constructor)(); copyProperties( result, refObj ); return( result ); } // copy public static function copyProperties( dstObj:Object, srcObj:Object ):Void { var to:String; for( var i in srcObj ) { to=typeof( srcObj[i] ); if( to != "function" ) { if( to == "object" ) { if( srcObj[i] instanceof Array ) { var p:Array = new Array(); var q:Array = srcObj[i]; for( var j:Number=0; j