因此,我創建一個自定義切換按鈕,包括財產CurrentValue的:整數重繪/刷新自定義皮膚
這樣我可以執行下列操作...
<fx:Script>
protected var currentValue:int = 0;
protected function changeValue(x:int):void{
currentValue = x;
}
</fx:Script>
<MyToggleButton currentValue="{updatedValue}" styleName="MyToggleStyle" click="changeValue(1)" id="first"/>
<MyToggleButton currentValue="{updatedValue}" styleName="MyToggleStyle" click="changeValue(2)" id="second"/>
這個腳本的想法是基於currentValue中的改變而改變的切換按鈕的外觀。每次我如何刷新切換按鈕,以便根據「currentValue」中的更改更新樣式?
P.S. MyToggleStyle將引用以mxml編寫的Skin類,該類將使用getStyle(「currentValue」)獲取當前值的更改