|
|
|
||||
|
||||
|
||||
My first 'real' experiment in Flash5 -- to create a simple, portable method of implementing custom cursors. The code is extremely compact (I'll do a tutorial when I get time) and flexible. You can download it here.
To use it in your own movie, just open the f5smartcursor.fla with the Open as Library option in the File menu and drag the 'cursor container' movie clip from the library into your own scene. You can put it anywhere, but you should ensure that it's on the highest layer otherwise it'll disappear behind other objects.
You can create your own cursor graphics and place them in individual frames in the Cursor Frames movie clip, being careful to give each frame a unique label. To create a different cursor for when the left button is pressed, give it the label 'cursorname_down', where 'cursorname' is the label of the cursor when the mouse is not pressed. For example, you might create a cursor called 'hourglass', but have a different version for when the mouse button is pressed, which would be called 'hourglass_down' (if you don't create one, the 'unpressed' movie clip will be displayed).
Finally, to actually activate the custom cursor, select the relevant movie clip, edit its actions (right click and select Actions, or go to the Instance pane and click the blue 'Edit Actions' arrow). Now add the following code:
onClipEvent (load) {
this.cursor = "cursorname";
}
...where cursorname is the label of the frame containing the cursor you wish to use. Now when the mouse passes over that movie clip, the cursor will change to the one specified. If by some accident you specify a cursor that doesn't exist, the mouse will disappear.
A tutorial will come when I get time.
PS: Thanks to Aquaman for the tip on how to make the movement smoother, and the stuff about Eval. Details in the tutorial...when it's done!
Good luck!
All files and text copyright ©Stickman 1998 - 2003. For copyright and terms of use information, please read this page.