If you have a label and you want to show a hand cursor when the mouse is over it you have to set three properties as bellow:
lbl.useHandCursor = true; lbl.mouseChildren = false; lbl.buttonMode = true;
where lbl is
public var lbl:Label = new Label();
Job’s done!
Tags: ActionScript, cursor, label
This post was written by Andrei Ionescu
Views: 7333









Excellent tip.
I was searching this for almost 4 hours and then i got this link .
Thanks Once again
ofc you can also use
ofc you can also use
(hmm, i wonder if it work now….)
Can this be done in CSS instead of attached directly to a label or image? I have many instances, 40+ now, where I’ve added these to images, labels both on their own and within dataGrids, setting them to use the hand cursor but having to add those three tags to every instance is a real pain. I tried creating a style named .hand, adding the three tags to the style and setting the style of the elements but can’t get it to work.
Hi,
useHandCursor, mouseChildren, buttonMode are control properties not control styles, so you can’t set those using css.
I think the solution for you is to make a new class that extends Label, and to set there as default properties those.
Here is a small example.
Class file: ButtonLabelClass.as
And you can use it like this:
Application file: ButtonLabel.mxml
Tnx, many other sites forget ‘mousechildren = false’.
Thanks for
mousechildren = false