开发者

Underline Flex mx:Text on mouseover using external CSS

开发者 https://www.devze.com 2023-04-01 14:51 出处:网络
I have some text in a Flex 3 application defined as follows <mx:Text id=\"textbutton\" text=\"Link Text\"

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.

0

精彩评论

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

关注公众号