Change cursor shape

Change_mouse_cursor100x100This tutorial will show you how to create a custom cursor shape to replace the ugly standard cursor. In fact, it is just a very simple  tutorial with some code inside and an image of  the cursor!

 

Before we get started, you need to find a nice cursor shape to play with. You can use the shape below (which is in png format)

new_cursor

Step 1: Create a new flash document and press Ctrl-J to open up the Properties box. Resize your document if necessary and increase the frame rate to 24 to make our new cursor moves smoothly

 Change_mouse_cursor_shape1

Step 2: Go to File>Import>Import To Stage and load your cursor from the Import dialog then select your shape and press F8 to convert it into a symbol. Name it "New cursor" and select Movie clip type and choose its Registration at the center

Change_mouse_cursor_shape2

Step 3:  Click on your shape to select it. Press F9 to open up the Actionscript tab and type in

onClipEvent(load)
{
    startDrag(this,true);
}

 

Change_mouse_cursor_shape3

This code tells the flash player that it has to use this shape as the cursor when this clip is loaded. This is the prototype of this function: startDrag(target, lockcenter)

target: this is what will be used. In this case, this keyword indicates this movie clip will be used

lockcenter: centers the movie clip or graphic to the mouse with its (the MC or graphic) center. This is done by entering either: true or false.

 

Step 4:  Create a new layer and name it "action". Select the frame 1 of this layer and type in the Actionscript tab of this frame:

Mouse.hide();

this code will hide the standard mouse

Now press Ctrl-Enter to test the result:

 

You can see programmers use this method very popular, especially in game, quiz or application. Hope you enjoy this tutorial!