Flex 4: htmlText property and hand cursor

2.3k Views Asked by At

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.

1

There are 1 best solutions below

6
On BEST ANSWER

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.