Looks like it was a community patch.  I don’t think it is quite right now.

ObjectUtil.copy with all classes involved having registerClassAlias should work.


On 2/17/10 9:10 AM, "Mike" <msl...@mslinn.com> wrote:






I just noticed the ObjectUtil.clone() method, new for Flex SDK 4.

public static function clone(value:Object):Object
 {
 var result:Object = copy(value);
 cloneInternal(result, value);
 return result;
 }

private static function cloneInternal(result:Object, value:Object):void
 {
 result.uid = value.uid;
 var classInfo:Object = getClassInfo(value);
 var v:Object;
 for each (var p:* in classInfo.properties)
 {
 v = value[p];
 if (v && v.hasOwnProperty("uid"))
 cloneInternal(result[p], v);
 }
 }

UID is discussed here: 
http://livedocs.adobe.com/flex/3/html/help.html?content=about_dataproviders_8.html

The clone() docs say "clone() differs from copy() in that the uid property of 
each object instance is retained."  Is that not true for ObjectUtil.copy() 
anyway?






--
Alex Harui
Flex SDK Team
Adobe System, Inc.
http://blogs.adobe.com/aharui

Reply via email to