you'd need some way of checking for circular references like Scott pointed out. Believe me when I say - i've been down that road several times with Xray.
var obj = new Object(); obj.prop1 = new Object(); obj.prop1.prop2 = new Object(); obj.prop1.prop2.ref = obj.prop1; bingo, you'e into 256 levels of recursion error. And no, it's not far fetched ;) alternative: Keith Peters Debug: http://mirror1.cvsdude.com/trac/osflash/xray/browser/DEV_Source/xray/classes/com/bit101/Debug.as I switched out xray's trace for Keiths just a couple of weeks ago because it worked on a per level basis for dispatching traces (rather than on big bulk of data) and it's really clean/readable code. You could alter it in no time to "clone" and object. However, mx.utils.ObjectCopy would work just fine ;) On 8/24/06, Steven Sacks | BLITZ <[EMAIL PROTECTED]> wrote:
> Careful with circular references. Pretty easy to get that one in to > exceed the 256 recursion limit. Feel free to post an alternative. :) _______________________________________________ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
-- [ JPG ] _______________________________________________ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com