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?