Creating a Custom Curser

Creating a Custom Curser

Flash CS4 ActionScript 3.0 Tutorial


How to Replace the Flash Default Curser with a Custom Curser



It is possible to change your curser in a swf file. The process involves hiding the default curser, then having a Movie Symbol track the user's mouse movements.

Tutorial Elements

Movie Symbol with instance name redDot_mc


Step One

Open a new Flash document and name the default layer, Content.

Step Two

Add a Movie Symbol with an instance name of redDot_mc. For more information on creating and assigning instance names to Movie Symbols, see topics, Movie Symbol Basics and Instance Naming.

Step Three

Add a new layer called Actions.

Step Four

Option double-click (PC - Alt double-click) the keyframe in the Actions layer to open the ActionScript panel.

Step Five

Copy/Paste the following code to the Actions panel.




Step Six

Test your movie by pressing Cmd/Return (PC - Ctrl/Enter). Move the mouse in the movie. Your red dot symbol replaces the default curser.

Dissecting the Code

The first line of the code hides the default curser. The second line makes it possible for your new curser to click and activate buttons and movie symbols.

The startDrag() method causes the Movie Symbol to follow the mouse movements.


Stock Photos from 123RF