Flash Tips : Custom Cursors

Making a custom cursor is fairly straightforward in Flash using just a few lines of Actionscript. First of all create a movie clip object that you want to be a cursor. For this example, I created a baseball cursor. After placing the movie clip on the timeline, I gave it an instance name of baseballCursor. Create an action layer and in the first frame, enter these lines of Actionscript.

Mouse.hide();
baseballCursor.startDrag(true);

That’s it. Pretty easy, eh? The resulting .swf is featured below. If using Internet Explorer, click in the frame to activate. Then whenever you move the mouse cursor within the boundary of the .swf movie, the cursor will change to the custom cursor, which in this case is the baseball.