我使用mx.controls.Button控件,我正在尝试更改其颜色:
import mx.controls.Button;
//...
var myButton:Button = new Button();
myButton.width = 70;
myButton.height = 30;
myButton.label = 'test';
myButton.setStyle('fillColors', [0x0f9f4f, 0x0f9f4f, 0x006600, 0x006633]);
addChild(myButton);
它不起作用。然而,cornerRadius风格和许多其他工作都很好。 如何更改按钮的颜色?
它出了什么问题?如何为按钮设置颜色?
答案 0 :(得分:0)
fillColors有两个参数,而不是四个。
ex:setStyle('fillColors', [0x000000, 0xFFFFFF])
http://livedocs.adobe.com/flex/3/html/help.html?content=skinstyle_3.html http://livedocs.adobe.com/flex/3/html/help.html?content=skinning_8.html