For a shallow copy, use a for in / for each loop.

var s:String = "";
for ( var p:* in o)
{
    s += p + ": " + o[p] + "\n";
}
trace(s);

For something more, like a tree, use mx.utils.ObjectUtils.toString.

I have a DebugWindow I use here so you don't have to toggle to FlexBuilder 
to see your traces.  Just drop the DebugWindow.mxml at the root of your 
project and go:

DebugWindow.debugHeader(), DebugWindow.debug("stuff"), or 
DebugWindow.debugProps(obj) in your code.
http://www.jessewarden.com/archives/2006/07/flex_2_webservice.html

----- Original Message ----- 
From: "Lisa Nelson" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Monday, July 17, 2006 12:12 PM
Subject: [flexcoders] Dump object to Console


Dear All,

More debugging woes.  I have some other cause of the debugger not
working in subcomponents - just blows by the breakpoints.

But I have a question that could maybe bypass 90% of the reason I tend
to use the debugger anyway.  Does anyone have a way of just dumping an
object to the console, or external file or something like that?
Something like trace, but that will handle an entire object with many
fields, and you don't have to know at compile time what all the fields
are.

--L



--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
Yahoo! Groups Links








--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to