Cursor

How do you make the cursor a pointer, instead of a hand when you go over a button in flash? With a mouseover effect (if that makes any difference)

thanks :rambo:

If you want a button that doesn’t have the cursor. Draw your button. Turn it into a movieclip and give it these actions:

onClipEvent (enterFrame {
if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
//play rollover animation
}

onClipEvent (mouseDown) { // like onPress
if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
//do whatever
}

onClipEvent(mouseUp) { // like onRelease
if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
//do whatever
}

just make ur botton a movie clip and in its action panel use this code

onClipEvent(enterFrame)
{
this.useHandCursor = false;
this.onRollOver = function ()
{
trace (“onRollOver called”);
};
}

this code will disable the hand cursor when you roll over ur movie (a button in ur case).

thats it

enjoy

button.prototype.onRollover = function() {
this.useHandCursor = false;
};

All buttons won’t have the cursor.

No need to make the button into a movie clip.

thats another way to do it, but as flex said, ALL buttons won’t have the hand cursor.
so felx, do you know any way to just have one button with a hand cursor disabbled and not all of them (without turning it into a movie clip)?

buttonInstanceName.prototype.onRollover = function() {
this.useHandCursor = false;
};

Replace buttonInstanceName with the button instance name.

button.prototype.onRollover = function() {
if (this._name == “buttonName” || this._name == “anotherName”) {
this.useHandCursor = false;
}
};

I suppose this would work too.

:q: :q: :q: Why are you messing with the onRollOver prototype??
Just put

but.useHandCursor=false;

and your cursor won’t turn into a hand…

pom :stuck_out_tongue:

Will buy.useHandCursor=false; work for ALL buttons. The code I posted was intended for all buttons.

As for for the one after (for a single button) then I suppose prototype’s not needed.

button.prototype.onRollover = function() {
for (var i=0; i<=5; i++) {
exclude = eval(“noCursorButton”+i);
if (this._name == exclude){
this.useHandCursor = false;
}
}
};

I have no idea if this works. But if you have 5 buttons you want excluded from the hand cursor, name then noCursorButton1 through 5.

The above code should eliminate these buttons from having the hand cursor.

Would that work?

I have a button called but and this code

but.prototype.onRollover = function() {
	this.useHandCursor = false;
};
but.onPress=function(){trace ("hey");}

I can see a hand…

pom :asian:

i guess an answer from u never fails, does it ilyaslamasse
?
:slight_smile:

thankx

If you would have read Ilyas’ AS Tricks section and how to use prototypes this wouldn’t have happened :stuck_out_tongue:

Just playin :beam:

Well, I’m not sure I have the answer here.

What’s for sure though:[list][]If you want that a few buttons don’t use the hand, just do it by hand, one by one[]If you want to disable the hand for all buttons, I don’t how to do that (yet :)), but messing with the onRollOver method of the button class won’t work, Flex. An example?[/list]

button.prototype.onRollover = function() {
      this.useHandCursor = false;
};

but.onRollOver=function(){trace ("hey");}

:-\

scratching head

I’ll think about it.

pom :cowboy:

Maybe this is just me but isn’t “button” supposed to be “<B>B</B>utton”?

I always did it as Button.prototype because if I don’t capitalize the B, then it doesn’t turn that bluish purplish color.

Flash is not case sensitive, Lost :slight_smile:

Oh yeah? then why does it change color when I change the case? Hmm, very interesting. I think it should change color no matter what if it isn’t case sensitive…all this time I have been memorizing the case of everything :-\

Oh and here… this works…

Button.prototype.onRollOver = function() {
	this.useHandCursor = false;
	but.onRollOver = function() {
		trace("hey");
	};
};

With this, the button with the instance name “but” will trace the work “hey” but all other buttons will not do anything (except not show the hand cursor)

button.prototype.onRollover = function() {
this.useHandCursor = false;
};

When I try that it does disable the hand for ALL buttons. As for the eval to distinguish between certain - that was just off top of my head - wasn’t sure.

But the above works for me for ALL buttons.

I’ll check that prototypes article out.

Refer to my previous post on how to distinguish.

All the AS Tricks are very handy, I recommend checking them out :slight_smile:

Thanks for those Ilyas! =)

Flex > Of course it works, but what if you want a button to trace “hey” on rollover, you’re screwed. When you change the rollOver, you erase the previous…

Lost > Cool. Now all your buttons say “hey” when you rollOver them :stuck_out_tongue:

pom :cowboy:

No they don’t, your method canceled out the onRollOver for the hand cursor.

So what I did was distinguished the but.onRollOver = function() inside the prototype, so still…only the button with the instance name “but” traces “hey” and has no hand cursor to boot. I tried it…it worked.