Creating a Mask


In Flash, using a mask is often called spotlighting. A mask is a shape in a layer that covers whatever is below it except for your defined area(s), functioning as the window through which the underlying image is seen. To help understand the concept, imagine that you have a photograph for which you want to make a quirky frame. You can take some fancy paper, cut an odd-shaped hole in it, and use this as a frame. When you place the paper on top of the photo, part of the photo shows through the hole in the paper.

To create a mask in Flash, first place an image on the stage (see Figure 9.33) and name its layer. It can be a vector graphic or an imported bitmap (see the previous section on importing bitmaps).

Figure 9.33. Photo on the stage.


Next add a new layer above the photo layer and name it. Making sure that this new layer is selected, draw a shape over the image (see Figure 9.34).

Figure 9.34. Shape that will be the mask.


Now you're ready to turn the new layer into a mask. Right-click on the layer you want to use as a mask and select Mask from the menu that opens. Your timeline layers should now be arranged as shown in Figure 9.35. Notice that the image is now hidden, except for the area covered by the shape.

Figure 9.35. Masked image.


You can also use text as a mask (see Figure 9.36). The process is the same as with any other mask, except that you use a text field in the mask layer instead of a shape.

Figure 9.36. Text masking a bitmap.


You might be wondering whether you can animate the shape in the mask layer. Yes you can! More on that in Chapter 10, "Animation Basics."



Special Edition Using Macromedia Studio 8
Special Edition Using Macromedia Studio 8
ISBN: 0789733854
EAN: 2147483647
Year: 2003
Pages: 337

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net