Skip to main content
Inspiring
April 15, 2006
Answered

mouse pointer / cursor questions

  • April 15, 2006
  • 2 replies
  • 410 views
hello everybody!

1


hey, i wanna customize my mouse pointer / cursor with a hand image.
and it looks like this:
defaut cursor = open hand.
over a clikable element = closed hand with a straight finger (like the default cursor over any html link)
pressed mouse button = same as the previous, but rotated a few degrees

and i get this code to add to the image cursor:

onClipEvent (load) {
Mouse.hide();
}
onClipEvent (enterFrame) {
this._x = _parent._xmouse;
this._y = _parent._ymouse;
}

onClipEvent (unload) {
Mouse.show();
}

then i have to add this code to any button:

on (press) {
tellTarget ("/cursor") {
gotoAndStop("down");
}
}
on (rollOver) {
tellTarget ("/cursor") {
gotoAndStop("over");
}
}
on (rollOut) {
tellTarget ("/cursor") {
gotoAndStop("default");
}
}

and a button with the movie size, at the bottom of all layers with this code:

on (press) {
tellTarget ("/cursor") {
gotoAndStop("down");
}
}
on (release, releaseOutside, rollOver, rollOut, dragOver, dragOut) {
tellTarget ("/cursor") {
gotoAndStop("default");
}
}

is there an easy way to do it, like in css?

<STYLE TYPE="text/css">
body {
cursor: url("default.cur");
}
a {
cursor: url("hand.cur");
}
</STYLE>



2


i also would like this, to work in dynamic textfields 'cause i load a .html file with links wich cntrol the movie and open external links... the way i do works, but when i move the mouse over a link of this dynamic textfield it also shows de default cursor, so i get MY image hand cursor with the default cursor...

hope u understand what i want, my english isn't good...

thanx in advance!
This topic has been closed for replies.
Correct answer
1. No, there is no easy way to do it like in CSS, the way you are doing it is how it must be done. Although much of the code you have is old code, tellTarget has generally been replaced by dot syntax:
tellTarget ("/cursor") {
gotoAndStop("down");
}
becomes simply:
_root.cursor.gotoAndStop("down");

Also, you probably will want to put Mouse.hide(); inside the enterFrame, and perhaps change enterFrame to mouseMove.

2. I've never found a way to do this.

2 replies

Correct answer
April 15, 2006
1. No, there is no easy way to do it like in CSS, the way you are doing it is how it must be done. Although much of the code you have is old code, tellTarget has generally been replaced by dot syntax:
tellTarget ("/cursor") {
gotoAndStop("down");
}
becomes simply:
_root.cursor.gotoAndStop("down");

Also, you probably will want to put Mouse.hide(); inside the enterFrame, and perhaps change enterFrame to mouseMove.

2. I've never found a way to do this.
gdmtAuthor
Inspiring
April 16, 2006
ok, thank u very much abeall!