天天看點

Flex建立一個UI component的全過程

請求component的構造器

設定component的屬性

調用父容器的addChild方法,這包括:

a) Flex設定component的parent屬性并引用其父容器。

b) 設定component樣式

c) component發送add事件(其實是flex發送,component是源)

d) 父容器發送addChild事件

e) Flex發送component的preinitialize時間

f) Flex建立并初始化component的子UI—如button元件顯示“确定”文本的text label

g) Flex發送Initialize時間

接下來,為了顯示component,一個render事件被觸發

a) Flex完成顯示component的所有必需過程,包括layout component

b) Flex設定component的visible屬性為true

c) Flex發送creationComplete事件

d) Flex發送組建的updateComplete事件

http://yimogod.iteye.com/blog/197200