如何更改Flex 4 Radiobutton选择的fontWeight

时间:2011-05-02 17:02:58

标签: flash actionscript-3 flex4 radio-button flash-builder

我一直在寻找一段时间,无法找到任何东西。在Flex中,我需要能够更改选择为粗体的RadioButton的fontWeight。因此,当选择RadioButton时,它将调用AS3中的一个函数来设置所选RadioButton的fontWeight ......

valveRadioGroup.addEventListener(Event.CHANGE, changeRadioHandler);

private function changeRadioHandler(event:Event):void {         
    //change this RadioButton's fontWeight to bold
}

未选中时,还需要恢复正常的fontWeight。有谁知道这是否可能?谢谢!

1 个答案:

答案 0 :(得分:0)

只需实施您自己的RadioButtonSkin(制作现有版本的副本)并在那里更改Label声明:

<s:Label id="labelDisplay" fontWeight.selectedStates="bold"
         textAlign="start"
         verticalAlign="middle"
         maxDisplayedLines="1"
         left="18" right="0" top="3" bottom="3" verticalCenter="2" />

您可以使用CSS或直接使用skinClass属性来应用此外观。