Custom Mouse Cursor Tutorial in Flash Actionscript 2
Looking for a way to change that boring old mouse cursor into something interesting and exciting? Then it sounds like you’re going to want a custom cursor in your flash. A custom cursor is a graphic which you draw that will take the place of the mouse cursor. In this tutorial, I’m going to show you how to make one.
1. Create a new movie clip by pressing Control+F8.
2. Name your movieclip cursor.
3. Draw your mouse cursor. Be creative here.
4. This part is optional, but I would suggest rotating the cursor a little bit, so it has the slight rotation that people are used to seeing.
5. Now you need to center the part that you want to be the clicker in the center of the stage, where that + symbol is.
6. Exit out of the cursor movie clip and go to the main stage.
7. Hit Control+L to bring up the library and drag your cursor onto the stage.
8. Click on your cursor and give it the instance name of cursor.
9. Bring up the frame’s actions, and put this code into the frame:
onEnterFrame = function (){//every frame... Mouse.hide(); //hide the regular mouse cursor startDrag(cursor,true); //drag the cursor in place of the mouse } //end of code
10. You could make the mouse hide just when the game loads, but then if a player uses the right click menu it will revert back to the old mouse. To prevent this problem, I made it so that the mouse hides every frame.
11. The mouse may lag a bit, so to prevent lag you will want to go into your game’s options and change the framerate to around 25.
12. Now hit Control+Enter to test your flash. The regular cursor should be gone, and your custom cursor should have taken it’s place.
13. Check out the example of a custom cursor in action and check to make sure that is the way yours looks.
Related posts:





April 12th, 2009 at 5:57 am
Hello, i need an A.S or Tutorial that if somethings hit you mouse or you hit something that your gameover
please send me a link
May 23rd, 2009 at 8:30 am
Great tutorial !
Thanks a lot dude !
November 23rd, 2009 at 5:02 pm
Great tutorial :) Easy to follow, thanks.
Is there a way to make the custom pointer disappear when you exit the frame?
:)
Hills
December 21st, 2009 at 9:57 pm
Awesome! Thanks so much. It works!
February 14th, 2010 at 9:26 am
This is not work :
**Error** Scene=Scene 1, layer=Layer 1, frame=1:Line 3: Operator ‘=’ must be followed by an operand
Total ActionScript Errors: 1 Reported Errors: 1