Underline Flex mx:Text on mouseover using external CSS
I have some text in a Flex 3 application defined as follows
<mx:Text id="textbutton"
text="Link Text"
click="doSomething()"
styleName="linkText"
buttonMode="true"
useHandCursor="true"
mouseChildren="false"/>
And an external CSS
declaration as follows:
.linkText {
/* text-decoration:underline;*/
color: #0000FF;
}
.linkText:hover {
text-decoration:underline;
}
It does not seem to work however as the text does not underline when I mouse over it.
Is there a way to do this purely through CSS
or do I need to progr开发者_StackOverflow社区ammatically capture the mouse events and set the styles accordingly (seems like overkill)?
No, you can't do this purely through CSS. You need to catch roll over and roll out mouse events and switch styles on it from some linkText
to linkTextUnderlined
using setStyle()
method.
精彩评论