How to change borderColor in Spark Button in runtime?
I need to set up some parameters in spark Buttons. I tried setStyle, but it doesn't work with borderColor.
My code is something like this:
for each (var prop:XML in option.elements()){
var but:spark.components.Button = new spark.components.Button();
but.label=prop
but.width=button_width
but.setStyle("verticalAlign",'middle')
but.setStyle('chromeColor', '#'+arrayRGB[j]) // arrayRGB have the colors i need
but.setStyle('borderColor','#'+arrayRGB[i]) //<-- Don't work
开发者_运维知识库 container.addElement(but)
}
Honestly, if you can create a new SkinClass for the button, set the Rect property in there, and give it a border, that's your best option. Then you can just to but.setSkinClass and control it from there.
Think of the button's "skin" has a child object to the button object and not just a property.
精彩评论