1. Technology
You can opt-out at any time. Please refer to our privacy policy for contact information.

Flash Cursor Spotlight Revisited II: Masking


We’ve looked at two ways to create a very basic cursor-tracking spotlight requiring little knowledge beyond basic Flash; now let’s take a look at another, using a more advanced—and yet still very easy—technique called Masking. Masking in general means to cover/obscure something; flash uses Masking layers that allow you hide layers beneath the mask and only reveal the areas that you choose. These Masking layers can be animated, as they consist of objects just like any other shape or symbol; they can be shape or motion tweened, and have ActionScripts applied to them.

It doesn’t quite work the way that you think; instead of creating an entire blocked-out layer and then erasing the cutout area to reveal what’s beneath, instead you create an object in the shape of the cutout. The only parts of the layers beneath that are visible will be the parts underneath that object. Everything else will be replaced by the base document color of the stage.

So with that in mind, I’ll open up the cityscape scene I created for the last two lessons, and modify the document properties to set the stage’s background color to black.

©2014 About.com. All rights reserved.