fillColors样式似乎不适用于Button

时间:2011-06-14 16:23:53

标签: flex actionscript-3

我使用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风格和许多其他工作都很好。 如何更改按钮的颜色?

它出了什么问题?如何为按钮设置颜色?

1 个答案:

答案 0 :(得分:0)

fillColors有两个参数,而不是四个。

ex:setStyle('fillColors', [0x000000, 0xFFFFFF])

你正试图设置fillAlpha吗?

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