Creating a Mask in Flash CS3

By: Tom Green , David Stiller ,

Set for printing

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:

  1. Open a new Flash document.
  2. 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.
  3. 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.

    If you are designing Flash movies and the stage is larger than the stuff on it, get into the habit of reducing the stage size. Wasted space, in the Flash universe, translates into increased download times. Remember, when you think Flash, think small.

  4. Add a new layer to the timeline.
  5. Select the Oval tool in the toolbox. Turn off the stroke and pick a fill color in the Tools panel.
  6. 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.
  7. 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.

    Creating a soft mask 
    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:

    1. Double-click the Mask movieclip to open it in the Symbol Editor.
    2. Add a new layer below the current layer.
    3. 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.
    4. Select the oval on the stage and select Edit >Cut to place the oval on the clipboard.
    5. Select the bottom layer containing the rectangle, and select Edit > Paste in Place to paste the oval into the rectangle. Deselect the oval.
    6. 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.

      Why not just do the delete thing when the oval is pasted onto the rectangle? When you pasted the oval, it was actually floating over the rectangle. Deselecting the object drops it onto the rectangle and makes it a part of that shape.

    7. Delete the empty layer and save your project.

      A mask with a hole. 
      Image 2. Poking a hole through an object creates a cutout that can be used as a mask