Search tutorials
Okay, we are going to learn how to make simple cursors. For example, crosshairs in shooting games, hands in grabbing games, etc. First, draw your cursor and convert it into a movieclip. Then double click it, and move the picture (if neccessary) around so that the little cross is at the area of the cursor where you want it to click. Now go back, and give the cursor the following actionscript:
onClipEvent(enterFrame) {
this._x = _root._xmouse;
this._y = _root._ymouse;
}
This script tells Flash that on the Frame it is in to follow the mouse. Now on the frame(s) that the cursor is in, type in the following actionscript:
Mouse.hide();
This tells Flash on those frames to hide the mouse. It'll still work, but you just won't see it. If you want to make the mouse reappear on a frame, give the frame this actionscript:
Mouse.show();
Obviously, this script makes the mouse reappear. That's all there is to it!
(note: you probably want to put the cursor on the very top layer so that it shows on top of everything.)
» Level Basic |
Added: 2005-03-17 Rating: 6.05 Votes: 21 |
» Author |
I am not the best Flash creator in the world, but I know quite a bit of useful information. |
» Download |
Download the files used in this tutorial. |
Download (0 kb) |
» Forums |
More help? Search our boards for quick answers! |