Skip to content

Trace Objects in Actionscript – From [object Object] To Object keys = values

December 8, 2009

Ever traced an object like so:

trace(object)   // this gives out: [object Object] 

which means nothing other than it was able to recognize the type of the object, but gives us nothing about the contents of the object. For this reason, the joyful people at Adobe have provided us with ObjectUtils (need to import mx.utils.ObjectUtil)

And this is done like so:

trace(ObjectUtil.toString(objectInstance)); // returns all the keys/values of the objectInstance.
Advertisements

From → AIR, Uncategorized

One Comment
  1. vatsalad permalink

    this post has been just in time for me – i was experimenting with ways to trace into an object. good!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: