I'm using this to clone data objects.  If you put circular references in
your data models that's not my problem.  :)



> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:flashcoders-
> [EMAIL PROTECTED] On Behalf Of John Grden
> Sent: Friday, August 25, 2006 6:37 AM
> To: Flashcoders mailing list
> Subject: Re: [Flashcoders] clone object
> 
> Guess there's a first time for everything, eh?
> 
> var obj = new Object();
> obj.prop1 = new Object();
> obj.prop1.prop2 = new Object();
> obj.prop1.prop2.ref = obj.prop1;
> 
> function clone(obj:Object):Object
> {
>     var o = (null != obj.length) ? [] : {};
>     for (var i in obj)
>     {
>         o [i] = (typeof obj[i] == "object") ? clone(obj[i]) :
>         obj[i];
>     }
>     return o;
> }
> 
> 256 levels of recursion were exceeded in one action list.
> This is probably an infinite loop.
> Further execution of actions has been disabled in this movie.
> 
> ;)
> 
> On 8/24/06, Steven Sacks | BLITZ <[EMAIL PROTECTED]> wrote:
> >
> > If you're not willing to code a solution, then why are you bothering
to
> > write out an explanation?  I have yet to encounter a recursion limit
and
> > I've parsed some deep object models.
> > _______________________________________________
> > [email protected]
> > 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  ]
> _______________________________________________
> [email protected]
> 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
_______________________________________________
[email protected]
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

Reply via email to