Creating a Mask in Flash CS3
By: Tom Green , David Stiller ,
You may have gone through the masking section and thought, "Gosh, the masks all have a hard edge. Is there a way to create a mask that fades the image out along the edges of the mask?" Great question. Prior to the release of Flash 8, it could be done, but the process was rather complex and, we might add, time-consuming. With the release of the Filters and Blend modes in Flash Professional 8, this task has become quick and painless.
In this exercise you are going to create a soft mask. Here's how:
- Open a new Flash document.
- Select File > Import > Import to Stage, and import the background.jpg image from the support docs to the stage. When the image appears on the stage, select it and convert it to a movieclip namedsoftmask.
- There is obviously a lot more stage than there is image. Click the stage, and in the Property inspector, click the Size button to open the Document Properties dialog box. Click the Contentsradio button to shrink the stage to the size of the image, and click OK.
- Add a new layer to the timeline.
- Select the Oval tool in the toolbox. Turn off the stroke and pick a fill color in the Tools panel.
- Make sure you are not in Object Drawing mode, and draw an Oval on the new layer, large enough to cover a lot of the image (see Image 1). This shape will be used to create the mask.
- Select the Oval and convert it to a movieclip named Mask. You can now delete Layer 2, which was only needed for creating an appropriately sized oval.
Image 1. The stage is ready for masking
Creating the Cutout for the Mask
With the objects created and converted to movieclips, you can turn your attention to the creation of the effect. What you need to do first is create the mask by manipulating the Mask movieclip:
- Double-click the Mask movieclip to open it in the Symbol Editor.
- Add a new layer below the current layer.
- Select the Rectangle tool and draw a large rectangle that goes well beyond the edges of the oval. Before you draw the rectangle, be sure to choose a contrasting fill color, and ensure that you are not in Object Drawing mode.
- Select the oval on the stage and select Edit >Cut to place the oval on the clipboard.
- Select the bottom layer containing the rectangle, and select Edit > Paste in Place to paste the oval into the rectangle. Deselect the oval.
- Select the oval and press the Delete key to cut a hole in the rectangle (see Image 2). If it doesn't look like it worked, change the stage color, and you'll see the oval showing through the hole in the rectangle.
- Delete the empty layer and save your project.
Image 2. Poking a hole through an object creates a cutout that can be used as a mask