PDA

View Full Version : useHandCursor in CSS?


charlesshoults
02-09-2009, 05:18 PM
When I first started putting together my project, all was good. When the mouse cursor rolls over a "button", the cursor changes to a hand and when moving off the button, it changes back to a hand. Later on, I began adding instances of images and labels that weren't buttons, but which I wanted to behave like them, including the hand cursor. Presently, I have 42 elements, for which I specify "useHandCursor = "true" buttonMode="true" mouseChildren="false". This makes 2600+ characters that I'd prefer not to have in my code.

How can these elements be put into CSS? In my app.css file, I used the following:
.hand
{
useHandCursor: true;
buttonMode: true;
mouseChildren: false;
}
I then set each component with styleName="hand", but it didn't work. Each instance of button continues to function as it should, but the stylistically-configured images and labels do not.

Help, please?

sipra
02-13-2009, 05:54 AM
I am facing same problem as you have.But as per the searching website they provided
Label{
useHandCursor: true;
buttonMode: true;
mouseChildren: false;
}
code but it still not working.If you want to ignore to write same thing repeatedly then you do the below thing,it works fine in my page.
public function mouseoverfunc(evt:Event):void
{
lbl.useHandCursor = true;
lbl.mouseChildren = false;
lbl.buttonMode = true;

img.useHandCursor = true;
img.mouseChildren = false;
img.buttonMode = true;
}
where lbl and img is the id of label and image and call this function on mouseover event.