Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Flex: How to set hand cursor?

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>

like image 700
Squiff Avatar asked Aug 12 '11 18:08

Squiff


2 Answers

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>
like image 181
Constantiner Avatar answered Sep 19 '22 08:09

Constantiner


If you want to set hand cursor in Label you must set mouseChildren=”false” and below is the revised code

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

Hope this works for you.

like image 44
user3215412 Avatar answered Sep 22 '22 08:09

user3215412