The Flash IDE Under the Hood
Reflection
In what seems like a lifetime ago I made the jump to AS 3.0, and along the way I’ve had all sorts of questions as to why things happen and what’s really going on behind the scenes. Recently I’ve discovered something very interesting to me that has helped me better understand some how’s and why’s.
Flash From the IDE Perspective
So you’ve got a project. You open up your trusty version of Flash and create a new AS 3.0 document. You create a button, load some xml, toss some images in and pretty much do your thing.
ActionScript 3.0 From a Class Perspective
So you progressed with AS 3.0 and plunged into class development. Now all the xml, button, and event functionality you’ve taken for granted must be imported. If you’re like me you probably said to yourself “mmmm ookay, whatever…” and you moved on. Well I’ve always wanted to know more about the default AS 3.0 .fla.
On a few occasions I got the crazy idea of tracing out it’s parent by opening up a default file and placing this code on the first frame.
-
trace(root)
-
// outputs [object MainTimeline]
What is this MainTimeline and more importantly what does it contain? Well just recently I came across some code that tells me.
-
-
trace(flash.utils.describeType(root))
-
You get an xml output of extended classes and parameters.
Some interesting elements
-
-
<extendsClass type="flash.display::MovieClip"/>
-
<extendsClass type="flash.display::Sprite"/>
-
<extendsClass type="flash.display::DisplayObjectContainer"/>
-
<extendsClass type="flash.display::InteractiveObject"/>
-
<extendsClass type="flash.display::DisplayObject"/>
-
<extendsClass type="flash.events::EventDispatcher"/>
-
<extendsClass type="Object"/>
-
As I started to dig deeper I went above the Main Timeline to the Stage and rain the similar trace.
-
-
trace(flash.utils.describeType(parent))
-
Conclusions
- Flash runs on xml… at least for preferences
- It’s pretty cool to see what the IDE is doing by default
- describeType can give me better insight into my objects
Tags: describeType, Flash