Sunday, 13 April 2008

Create a custom cursor in flash

This flash tutorial will teach you how to create a custom cursor in Macromedia Flash. Custom cursors are useful for games, websites and multimedia applications. This custom cursor is made in Actionscript 2.0.

**UPDATE: New Custom cursor in Actionscript 3.0 now available.

Create a custom cursor in Flash

Step 1

Create a new flash document. Select any colour as your background.


Step 2

Draw your custom cursor on stage. I made a cross hair using the oval tool (O) and line tool (N) and fill the shape red. You can design whatever you wish.
Make sure your cursor is an appropriate size.

Photobucket


Step 3

Take the selection tool (V) and highlight your custom cursor on the stage. Select F8 to convert it to a symbol. Choose an appropriate name and check the movie clip button and click Ok.

Photobucket


Step 4

Select the custom cursor and give it an instance name. eg. cursor_mc.

Photobucket


Step 5

Create a new layer on the time line and call it "actions".
Right click on the 1st frame of the actions layer and select actions.

Photobucket


Step 6

Type the following code the in the actions box:

Mouse.hide();

cursor_mc.onMouseMove = function(){
this._x = _root._xmouse;
this._y = _root._ymouse;
updateAfterEvent();
};

**This small piece of code basically hides the existing cursor and replaces it with your custom cursor.


Step 7

Choose Ctrl + Enter to test movie.



You should now have a custom cursor. Feel free to contact me for any questions or comments.

Checkout custom cursor part 2.


**UPDATE: Custom cursor in Actionscript 3.0 now available.

6 comments:

Wow said...

I love this guide, Thank you for posting it up. It helped me alot.

Jenny Renigen said...

how can i save it for use in the control panel?

iliketo said...

@ Jenny Renigen

Can you explain what you mean?

Patrick said...

I'm getting Compiler Error messages when I export the movie.

iliketo said...

@Patrick

What does the compile error say?

Ditta said...

verry good

Post a Comment

Welcome to ilike2flash! If you like this post you can subscribe here to get updates via RSS or opt to have them sent directly to your inbox .

I appreciate your feedback, so please feel free to comment.