Tuesday, September 29, 2009
Reflection in ActionScript
After a little digging it turns out that Flash has a nice reflection function to discover information about a type. The function, called describeType(), returns an XML object populated with data such as the full qualified name of the class, all its methods, what class it extends from etc. Why is this useful? Well, it gives you the chance to find out at runtime what kind of object you have. I wonder if you can use something like this to implement a version of Reflector (a .NET tool that lets you view code from assemblies) for ActionScript?
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment