Hi, I'm trying to make a toggle button that uses one style
when it's selected and another when it's not. Below is my code
defining the style but I don't know how to use this to make a
toggle button. I can set the initial style but not the one when
it's clicked. I'd like to be able to use a script to toggle the
Styles and skins are two different things. A skin is visual
or graphic element of a component and a style controls that. For
example, using a normal Flex button, the color style changes the
color of the Button's label. If you wanted a square, gradient
filled button you would want to make skin. Then the skin might use
a style like 'gradientColor' which it would use to make red, green,
blue, etc. buttons.
The problem with the default Button skin is that a style like
fill-colors is applied only to the un-selected state. To do what
you want to do you should use skins.
There is a chapter in the Flex docs about making skins.
Applying skins can be done in a style sheet: