Flex启动顺序
<mx:Application>
<mx:Canvas id="canvas" width="100%" height="100%">
<mx:List id="list" width="500" height="300"/>
</mx:Canvas>
</mx:Application>
0 application: preinitialize
1 application: childAdd
2 application.canvas : add
3 application.canvas : preinitialize
4 application.canvas : childAdd
5 application.canvas.COMPONENT : add //组件是先被添加,然后该组件才开始初始化
6 application.canvas.COMPONENT : preinitialize //
7 application.canvas.COMPONENT : initialize
8 application.canvas : initialize
9 application: initialize
10 application.canvas.list : creationComplete
11 application.canvas : creationComplete
12 application: applicationComplete
事件说明:
add: 组件被添加到容器上(addChild, addChildAt)时发出
preinitialize: 预初始化时发出
initialize: 完成构造,所有属性都被设置完成后发出
creationComplete: 完成构造,属性,测量,布局,绘制后发出
applicationComplete: Dispatched after the Application has been initialized, processed by the LayoutManager, and
attached to the display list.
=======================其他==========================
uicomponent.updateComplete : Dispatched when an object has had its commitProperties(), measure(), and
updateDisplayList() methods called (if needed).
当commitProperties(), measure(), and updateDisplayList()被调用时派发
updateDisplayList:
updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
Draws the object and/or sizes and positions its children.
绘制对象的子对象的大小,位置.
不可以直接调用该方法。 当该组件被通过addChild方法添加到容器上 或 组件的invalidateDisplayList()方法被调用时,
Flex会调用updateDisplayList()方法