O'Reilly logo

Flash 8: The Missing Manual by E. A. Vander Veer

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Spotlight Effect Using Mask Layers

Imagine placing a sheet of red construction paper containing a cutout of a star over a piece of green construction paper. The result you see, when you look at the two sheets stacked on top of each other, is a green star on a red background.

That's the concept behind mask layers, a special type of layer that lets you create shaped "portholes" through which content in an underlying (masked) layer appears.

As you may have noticed, mask layers are horribly misnamed. In real life, masks hide stuff. In Flash, masks reveal stuff. Still, if you can keep the difference straight in your mind, they're easy to use. And when you apply a motion tween to the "porthole," you can create an effect that looks like a spotlight playing over an image—mighty cool, indeed.

Here's how you go about it:

  1. Open the file mask_begin.fla.

    You can download this file, a working example of the file (mask.fla), and all the other examples shown in this chapter from the "Missing CD" page at www.missingmanuals.com/cds.

  2. Click Layer 1 to select it.

    In the example file for this section (mask.fla), Layer 1 contains a bitmap image.

  3. Click the Insert Layer button.

    Flash creates a new layer named Layer 2 and places it above Layer 1.

  4. Double-click the layer icon next to Layer 2.

    The Layer Properties window appears.

  5. In the Layer Properties window, turn on the checkbox next to Mask and then click OK.

    Flash displays the mask icon next to Layer 2 (Figure 6-12).

  6. Double-click the layer icon next to Layer ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required