# Cursor

**URL:** <https://forum.kirupa.com/t/cursor/6209>\
**Category:** flash\
**Created:** [October 1, 2002, 11:38pm UTC](https://forum.kirupa.com/t/cursor/6209 "2002-10-01T23:38:09Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![ryuujin386](https://avatars.discourse-cdn.com/v4/letter/r/f4b2a3/32.png) [@ryuujin386](https://forum.kirupa.com/u/ryuujin386)\
**Post date:** [October 1, 2002, 11:38pm UTC](https://forum.kirupa.com/t/cursor/6209/1 "2002-10-01T23:38:09Z")

</div>

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:

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [October 2, 2002, 12:04am UTC](https://forum.kirupa.com/t/cursor/6209/2 "2002-10-02T00:04:50Z")

</div>

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

```auto
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
}

```

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [October 9, 2002, 8:20pm UTC](https://forum.kirupa.com/t/cursor/6209/3 "2002-10-09T20:20:07Z")

</div>

## 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

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [October 9, 2002, 8:31pm UTC](https://forum.kirupa.com/t/cursor/6209/4 "2002-10-09T20:31:53Z")

</div>

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

All buttons won’t have the cursor.

No need to make the button into a movie clip.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [October 9, 2002, 8:38pm UTC](https://forum.kirupa.com/t/cursor/6209/5 "2002-10-09T20:38:39Z")

</div>

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)?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [October 9, 2002, 8:43pm UTC](https://forum.kirupa.com/t/cursor/6209/6 "2002-10-09T20:43:26Z")

</div>

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

Replace buttonInstanceName with the button instance name.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [October 9, 2002, 8:44pm UTC](https://forum.kirupa.com/t/cursor/6209/7 "2002-10-09T20:44:59Z")

</div>

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

I suppose this would work too.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [October 9, 2002, 8:58pm UTC](https://forum.kirupa.com/t/cursor/6209/8 "2002-10-09T20:58:17Z")

</div>

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

```auto
but.useHandCursor=false;

```

and your cursor won’t turn into a hand…

pom 😛

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [October 9, 2002, 9:00pm UTC](https://forum.kirupa.com/t/cursor/6209/9 "2002-10-09T21:00:55Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [October 9, 2002, 9:01pm UTC](https://forum.kirupa.com/t/cursor/6209/10 "2002-10-09T21:01:23Z")

</div>

I have a button called but and this code

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

```

I can see a hand…

pom :asian:

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [October 9, 2002, 9:01pm UTC](https://forum.kirupa.com/t/cursor/6209/11 "2002-10-09T21:01:37Z")

</div>

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

thankx

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [October 9, 2002, 9:06pm UTC](https://forum.kirupa.com/t/cursor/6209/12 "2002-10-09T21:06:26Z")

</div>

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

Just playin :beam:

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [October 9, 2002, 9:07pm UTC](https://forum.kirupa.com/t/cursor/6209/13 "2002-10-09T21:07:03Z")

</div>

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]

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

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

```

:-\

_scratching head_

I’ll think about it.

pom :cowboy:

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [October 9, 2002, 9:08pm UTC](https://forum.kirupa.com/t/cursor/6209/14 "2002-10-09T21:08:39Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [October 9, 2002, 9:10pm UTC](https://forum.kirupa.com/t/cursor/6209/15 "2002-10-09T21:10:43Z")

</div>

Flash is not case sensitive, Lost 🙂

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [October 9, 2002, 9:11pm UTC](https://forum.kirupa.com/t/cursor/6209/16 "2002-10-09T21:11:54Z")

</div>

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…

```auto
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)

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [October 9, 2002, 9:13pm UTC](https://forum.kirupa.com/t/cursor/6209/17 "2002-10-09T21:13:43Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [October 9, 2002, 9:16pm UTC](https://forum.kirupa.com/t/cursor/6209/18 "2002-10-09T21:16:13Z")

</div>

Refer to my previous post on how to distinguish.

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

Thanks for those Ilyas! =)

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [October 9, 2002, 9:17pm UTC](https://forum.kirupa.com/t/cursor/6209/19 "2002-10-09T21:17:43Z")

</div>

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 😛

pom :cowboy:

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [October 9, 2002, 9:19pm UTC](https://forum.kirupa.com/t/cursor/6209/20 "2002-10-09T21:19:02Z")

</div>

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.

[Next page](https://forum.kirupa.com/t/cursor/6209.md?page=2)
