I need hand cursor to appear on roll over spark Label. I've tried useHandCursor
+ buttonMode
properties, but no result. And is there anything like htmlText property for spark Label (I need underline)? Any alternative solutions are welcome. Thanks.

- 7,244
- 7
- 33
- 59
1 Answers
Does this code suites your needs?
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:mx="library://ns.adobe.com/flex/mx"
xmlns:s="library://ns.adobe.com/flex/spark">
<s:Label buttonMode="true" horizontalCenter="0" text="Test" textDecoration="underline" verticalCenter="0" />
</s:Application>
If you want to have ability to mix styles together you can use the following:
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:mx="library://ns.adobe.com/flex/mx"
xmlns:s="library://ns.adobe.com/flex/spark">
<s:RichText buttonMode="true" horizontalCenter="0" verticalCenter="0">
<s:content>Hello, <s:span textDecoration="underline">World</s:span>!</s:content>
</s:RichText>
</s:Application>
According to documentation:
The Spark architecture provides three text "primitives" -- Label, RichText, and RichEditableText -- as part of its pay-only-for-what-you-need philosophy. Label is the fastest and most lightweight, but is limited in its capabilities: no complex formatting, no scrolling, no selection, no editing, and no hyperlinks. RichText and RichEditableText are built on the Text Layout Framework (TLF) library, rather than on FTE. RichText adds the ability to render rich HTML-like text with complex formatting, but is still completely non-interactive. RichEditableText is the slowest and heaviest, but can do it all: it supports scrolling with virtualized TextLines, selection, editing, hyperlinks, and images loaded from URLs. You should use the fastest one that meets your needs.

- 14,231
- 4
- 27
- 34
-
Definitely! Thanks for `textDecoration`, Konstantin. Suppose I didn't try `useHandCursor` and `buttonMode` together. – Timofei Davydik Apr 26 '11 at 08:09
-
I've added a sample with mixing styles together in one single label. – Constantiner Apr 26 '11 at 08:14
-
And sorry for confusing using `useHandCursor`. Setting `buttonMode` to `true` is enough for hand cursor. – Constantiner Apr 26 '11 at 08:18
-
@Constantiner I have tried using `buttonMode` alone, but it does not seem to work. I guess we have to set even the `useHandCursor` – Anji Apr 26 '11 at 08:23
-
@Anji did you try to run code samples I posted? They work fine without `useHandCursor`. – Constantiner Apr 26 '11 at 08:28
-
Doesn't seem to work in 4.5.x. Either with buttonMode alone, or with buttonMode and useHandCursor (or with buttonMode, useHandCursor, and mouseChildren). – Ross Henderson Oct 20 '11 at 21:06