Flex2的LinkButton没有设置背景色的属性,只能曲线解决了。使用LinkButton.graphics画一个背景。
xml 代码
- xml version="1.0" encoding="utf-8"?>
- <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"
- creationComplete="init()">
- <mx:Script>
- private function init():void {
- linkBtn.graphics.beginFill(0xff0000);
- linkBtn.graphics.drawRect(0, 0, linkBtn.width, linkBtn.height);
- linkBtn.graphics.endFill();
- }
- ]]>
- mx:Script>
- <mx:LinkButton id="linkBtn" label="myButton" x="10" y="10"/>
- mx:Application>