You are right about the ordering of the events.  The add event means that
this component is in and complete.  The way the flex framework does events
is by working from the inside out.  So if you listen on a container for an
event it means that all its children have already been committed to that
state.  So for you to receive an add event for a container you would have
already received add events for all its children.  That is they have all
been added to the container before the container is added to the
displaylist.
If you think of it in the context of creationComplete it makes more sense.
 Every child must be complete before the container can be complete.  And all
the other events work in the same manner.

HTH,
simeon

>
> After testing in the debugging console, it seems for the same
> component, the "add" event is dispatched before the "preintialize"
> event. So I assume that an "add" event happens when Flex calls the
> "addChild" to add the component to the DisplayList; similar story
> happens for an "remove" event. But further investigation reveals that
> if a Container with all its inner components is attached to an
> "AddChild" node under a "State" node under one pass, its descendant
> components "add" events happen before the container's "add" event. In
> the following code, the "add" events for "tXt1" and "bTn1" happen
> before the "add" event for the "vBx1":
>

Reply via email to