看到網上關於FLEX4的內容並不多,把學習中遇到的問題及解決方法記在這裏,利人利己^ ^
在原來的FLEX3中是這麼追加的:
<mx:states>
<mx:State name="State1"/>
<mx:State name="State2">
<mx:AddChild position="lastChild">
<!-- 添加追加的組件-->
</mx:AddChild>
</mx:State>
<mx:states>
但是在FLEX4這麼做編譯的時候會報錯!這個問題糾結了好久,終於在一個英文網站上找到了正確的答案。
只能這麼做:
<s:states>
<s:State name="State1"/>
<s:State name="State2"/>
</s:states>
<!--追加一個lable-->
<s:Label x="57" y="29" text="addlable" height="12" includeIn="State2"/>
這樣就在state2中添加了一個lable。