How are Flash library symbols constructed? Why are width/height already available in constructor?
Posted
by Triynko
on Stack Overflow
See other posts from Stack Overflow
or by Triynko
Published on 2010-04-30T20:10:39Z
Indexed on
2010/04/30
20:17 UTC
Read the original article
Hit count: 258
Suppose I draw a square on the stage, convert it to a symbol, export it for ActionScript with a classname of "MySquare" (and of course a base class of MovieClip).
How is it that in the MySquare constructor, the width and height of this MovieClip are already available? In fact, any named instances in the clip are also available.
I'm confused about how the Flash player seems to be able to pre-construct my movie clip by populating its properties and child clips before my constructor for the class ever runs.
I thought that it would have to first construct the clip, calling my constructor code, and then construct and add any children, but obviously the player is doing something special for clips designed in the Flash authoring environment.
© Stack Overflow or respective owner