简体   繁体   中英

Adobe Flex Set style for component state

I have a gradient

<s:LinearGradient rotation="90">
   <s:GradientEntry id="gradient1" color="0xFAFAFA"
                    color.over="0xC7C7C7"
                    color.down="0xBBBBBB" />
   <s:GradientEntry id="gradient2" color="0xF0F0F0" 
                    color.over="0xB2B2B2"
                    color.down="0x8B8B8B" />
</s:LinearGradient>

and I would like to keep the 3 color values for each gradient in a CSS style sheet. I dont want to create a style for all GradientEntrys, I want this to be specific to only these two gradients. I know how to do this for the color property, but how do I set it for the color.over and color.down?

Any help is appreciated Thank you

In order to set specific values for a style property on different states, you can use the : operator like this:

#myButton
{
        chromeColor: #eeee00;
}

#myButton:down
{
        chromeColor: #ee00ee;
}

This will tell Flex to use a different color on the down state of #myButton .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM