Flash MX 2004 - Masking Mouse Cursor

Adobe Flash CS3 Professional
Flash CS3 introduces many new and exciting features and delivers an entirely new experience in Flash dev.
Adobe Flash CS3
Adobe Creative Suite 3
Streamline your web dev with a collection of Adobe software including the new Flash CS3 Pro.
Adobe Creative Suite 3
Ok so it's not really a cursor, but this tutorial will teach you how to create a mask that follows your mouse wherever it goes.

Step 1

First off, rename Layer 1 to text. Select Frame #1 and create the text that you want to be masked. I simply created 5 lines placed vertically which say "visual intensity (dot) com". With Frame 1 still selected, hit F9 to bring up the Actions Panel and paste this stop command:

stop();

Step 2

Insert a new layer either by going to Insert > Timeline > Layer or clicking the Insert Layer button at the bottom left corner of the Timeline. Make sure this new layer is ABOVE the layer with your text on it. Rename the layer to mask.

mask
text


A mask layer will automatically mask the layer directly below it, so make sure you have them in the right order.

Step 3

Now we're going to create a movie clip that will work as the actual mask. Hit Ctrl + F8 or go to Insert > New Symbol. Name it mask and make the Behavior a Movie clip. With the Oval Tool (O) draw out a decent sized circle, the size is really up to you but don't make it too big. You still want most of your text to be hidden, but want the mask to be large enough so you can read the text as it's moused over. Make sure your circle is centered in the MC. If you don't see the Align panel, hit Ctrl + K or go to Window > Design Panels > Align. Make sure the "To stage:" button is selected and click the Align horizontal center and Align vertical center buttons.

Step 4

Now go back to your main stage (Hitting Scene 1 at the top of the Timeline). Make sure Frame 1 of the mask layer is selected and drag your mask MC from the Library (Ctrl + L) onto the stage. Making sure the MC is selected, in the Properties Inspector (Ctrl + F3 or Window > Properties) give it an Instance Name of mask. Now bring up the Actions Panel (F9) and add this line of code:

startDrag(_root.mask, true);

Step 5

One last step is to set the mask. Right click on your top (mask) layer, and choose Mask from the menu options. This should lock both layers. To do further editing, you will need to unlock the layers (by clicking the lock symbol on the layer).

Step 6

Test your movie! You should now have a mask that follows your mouse.

Working Example