Create a flash custom cursor - AS2

view all ยป


This is a quick tutorial to show you how to banish the standard mouse cursor and replace it with you own creation in two VERY simple steps! Your end result will be somthing like this:

STEP 1

Open a new actionscript 2 file, set the framerate to 30 and rename layer 1 to ‘cursor’. Create a new layer called actions. On the cursor layer, draw your custom cursor. This can be ANYTHING you like. As you can see I have gone with a target, useful for flah shooting games etc.

Once you have drawn your cursor, select all of it and press f8 to convert it to a movieClip. Name it MC_cursor, and set the registration point to where you want the ‘tip’ of the cursor to be. For example, I have set it central as the click area is the center of my target.

Once you have done this, give your movieClip an instance name of MC_cursor.

STEP 2

The next and final step is to add the actionscript to replace the cursor. Select frame 1 on the actions layer, press f9 to access the actions panel and add the following lines of actionscript:
Mouse.hide()
startDrag(MC_cursor,true)

The first line simply hides your standard mouse cursor. The second line will make the movie clip MC_cursor get continually dragged by the hidden mouse cursor. Hit CTRL + enter and see it in action. Simple!

This is a great way to customise you flash applications, websites and games in two simple steps. So experiment and see what you can come up with!

Enjoy :)

The Dude

Did this tutorial help you? If so, click the bookmark button, stumble me, add me to your twitter and tell your friends! Alternatively, sign up and leave a comment!

Not what you were looking for? Then leave a comment or email me and we’ll get you the tutorials you need.

Did this post help you? If so help us continue to grow and Digg this page or Share on Twitter!

If you haven't already, sign up to our RSS feed or register to recieve updates direct to your email!

6 Responses to “Create a flash custom cursor - AS2”


  1. Hey more pics please, you must balance the text and the pictures :D


  2. Your voice has been heard, and comments noted! I will provide more pics for future tutorials :)

  3. The Arm

    Question: If I want to have a custom cursor in one scene of my movie, can I…de-customize it for the next scene(s)?
    And thanks, btw.


  4. Question: I have put Actionscript together for using a new curser. How can I make the curser change to a new picture when mouse is clicked.


  5. Great, i have been looking for something similar…

  6. GAFAAAAA

    I need help i am making a shooting game, this new cursor is great but i have a target that i can no longer click, can help me?

    not sure if this is the problem but just in case this is the actionscript of the target(moves randomly once hit):

    on(press){_x=random(500);_y=random(350)}

Leave a Reply