Custom Mouse Cursor


Description: Remove the default mouse cursor and replace it with your own
Author: John Bezanis
Added: March 1st 2007
Version: Flash 8
This simple tutorial demonstrates how to replace the default cursor with a custom one.
First, draw the cursor you'd like to use. Select the graphic using the Selection Tool. Right-Click and select Convert to symbol. Set the name to cursor, the type to Movie Clip, and click Export for ActionScript. Make sure the Identifier is set to cursor. Click OK. Double-click the newly created symbol open and to edit the cursor's position. Move the position so it suits your needs, and double-click the stage outside of the graphic area. This will bring you back to the main level. Now that the cursor graphic is finished, click it and hit delete on the keyboard. It is ok to delete the graphic because it has been added to the library, so we can re-add it using actionscript. Click somewhere on th stage and open up the Actions Frame and insert the following code:
- Mouse.hide();
- this.attachMovie("cursor", "cursor", this.getNextHighestDepth());
- cursor.onMouseMove=function(){
- cursor._x=_xmouse;
- cursor._y=_ymouse;
- cursor.swapDepths(this.getNextHighestDepth());
- updateAfterEvent();
- }
The source file is available below for download.
Download Source File
Comments Currently Disabled