Show hand cursor on any Flex control

It is a little bit strange how Flex acts about showing hand cursor over some controls. For example if you use LinkButton control, than hand cursor will be shown when you hover over the area of the button. But, I don’t know why this does not happen when you use Button control. If you want to show hand cursor when hovering over any control you have to set useHandCursor and buttonMode to true (useHandCursor=”true” buttonMode=”true”).

For Button control we would thus use:

<mx:Button label="Button" useHandCursor="true" buttonMode="true" />

But what happens when you try to use this on Label control, well, I does not work, you have to set mouseChildren to false (mouseChildren=”false”), with this even Label will show hand cursor on mouse over 🙂

<mx:Label text="Label" useHandCursor="true" buttonMode="true" mouseChildren="false"/>

You can see the how hand cursor is shown in the example above by visiting this URL:
http://www.tdteam.com/work/engineeringtheworld/useHandCursor.swf

, , , ,

  1. Leave a comment

Leave a comment