开发者

Flex 4 Skin:Specifying state for an attribute in script

开发者 https://www.devze.com 2023-01-15 04:45 出处:网络
I\'m trying to create a button skin, where i can set fillCol开发者_如何学编程ors like in a Flex 3 button, using CSS.

I'm trying to create a button skin, where i can set fillCol开发者_如何学编程ors like in a Flex 3 button, using CSS. It was easy to set the color of the gradients, by reading them from the CSS: adding a few lines in updateDisplayList: fillGradient1.color = fillColors[0]; ...

How can i set the colors for the other states, from script? I tried adding fillGradient1.color.down = fillColors[2] and it's not working...


in a short/fast

read http://unitedmindset.com/jonbcampos/2009/07/02/flex-4-spark-skinning/

at the bottom of article you'll find CSS usage, so call styles for different states - different.

And yes you are not able to get colors from style by .state, but you could use it in skin like:

<local:childComponent styleName.state="optional" .../>

0

精彩评论

暂无评论...
验证码 换一张
取 消