View Full Version : problem with useHandCursor
bobby solo
September 11th, 2007, 07:34 AM
hi all,
does anyone know whats wrong with this piece of code. i have a text field within a movieclip and i would like the hand cursor to show when the mouse passes over it. but the hand won't show, i'm not sure if the text field is influencing the outcome.
thanks for any help :toad:
var mc:MovieClip = new MovieClip();
mc.useHandCursor = true;
addChild(mc);
var printfield:TextField = new TextField();
printfield.border= true;
printfield.selectable = false;
mc.addChild(printfield);
senocular
September 11th, 2007, 11:01 AM
useHandCursor only works when mc.buttonMode = true.
bobby solo
September 11th, 2007, 11:50 AM
thanks for the answer, unfortunately it doesn't work. tried it out before this post.
senocular
September 11th, 2007, 12:29 PM
the textfield is interfering. Use
printfield.mouseEnabled = false;
bobby solo
September 11th, 2007, 04:01 PM
thanks senocular,
does the job great now. here are the changes if anyone ever has the same problem.
var mc:MovieClip = new MovieClip();
mc.useHandCursor = true;
mc.buttonMode = true;
addChild(mc);
var printfield:TextField = new TextField();
printfield.border= true;
printfield.selectable = false;
printfield.mouseEnabled = false;
mc.addChild(printfield);
jarin
March 25th, 2009, 09:04 AM
thanks senocular,
does the job great now. here are the changes if anyone ever has the same problem.
hm i'm having a similar problem but this isn't helping..here's my code that's attached to my mc if anyone can help!
onClipEvent (enterFrame) {
useHandCursor = true;
buttonMode = true;
if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
_root.scrollbox_mc.content_mc.box01.nextFrame();
} else {
_root.scrollbox_mc.content_mc.box01.prevFrame();
}
}
lewi-p
March 25th, 2009, 12:08 PM
jarin,
buttonMode only works in AS3...the code you're using is AS2. Whatever object it is that you have this onClipEvent on, you'll need to convert it to a button for the hand cursor to show.
Remove the useHandCursor & buttonMode lines from the onClipEvent too.
*EDIT*
...or you could just add;
on (rollOver){}
to the actions of your object...that would show the handCursor too.
lewi-p
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.