如题,做记录。代码未测试,可能需要换成创建监听
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" minWidth="955" minHeight="600" xmlns:ns1="*" color="#FFFFFF" fontSize="14">
<ns1:MyRadioButton label="给文字滤镜效果" x="407" y="170"/>
</mx:Application>
package
{
/*带有文字滤镜效果的Flex按钮组件*/
import flash.events.Event;
import flash.filters.GlowFilter;
import mx.controls.RadioButton;
public class MyRadioButton extends RadioButton
{
public function MyRadioButton()
{
addEventListener(Event.ADDED_TO_STAGE,addHandler);
}
private function addHandler(evt:Event):void
{
removeEventListener(Event.ADDED_TO_STAGE,addHandler);
textField.filters = [new GlowFilter(0,0.9,2,2,5)];
}
}
}