0

Flex: How to set the hand cursor?

 7 months ago
source link: https://www.codesd.com/item/flex-how-to-set-the-hand-cursor.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Flex: How to set the hand cursor?

advertisements

I'm trying to set the hand cursor on an HBox. I've tried buttonMode and useHandCursor but have had no luck. This example displays the busy cursor. Can anyone tell me how to make it display the flashPlayer's hand cursor?

<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
           xmlns:s="library://ns.adobe.com/flex/spark"
           xmlns:mx="library://ns.adobe.com/flex/mx" xmlns:components="com.dn2k.components.*"  >

<fx:Script>
    <![CDATA[
        private var cursorID:int;
        //cursorManager

        protected function box_mouseOverHandler(event:MouseEvent):void
        {
            cursorManager.setBusyCursor()
        }
    ]]>
</fx:Script>

<mx:HBox id="box" useHandCursor="true" buttonMode="true" mouseChildren="false" backgroundColor="0xcc0000" mouseOver="box_mouseOverHandler(event)">
    <s:Label text="Hiya sexy..."/>
</mx:HBox>


This code shows it perfectly while mouse is over container:

<?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">
    <mx:HBox backgroundColor="0xcc0000" buttonMode="true" id="box" mouseChildren="false" useHandCursor="true">
        <s:Label text="Hiya sexy..." />
    </mx:HBox>
</s:Application>


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK