describeType – an important note

In one of my previous posts (Acedia – apathy and laziness in the practice of virtue), i spoke about the extremely helpful function describeType.

While busy on a project this weekend, i ran into a little problem using describeType and thought i’d put a solution to it on my blog in case anybody runs into the same problem. The problem arose when i used describeType on a bindable class. When a class is made bindable using the [Bindable] syntax, the describeType will not return public variable names, it will return accessors and a whole bunch of other information.

In this situation, instead of typing: var variables:XMLList = describeType(myClass)..variable; try using this: describeType(myClass)..accessor; This will still do the same thing as in the previous example, but will return all the variables in a bindable class.

Hope it helps!

Advertisement

~ by as3fd on October 25, 2008.

Leave a Reply

Please log in using one of these methods to post your comment:

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 )

Connecting to %s

 
Follow

Get every new post delivered to your Inbox.