Create the mask
The mask can be any filled
shape. The color of the fill doesn’t matter. What’s important to Flash
is the size, location, and contours of the shape. The shape will be the
“peephole” through which you’ll see the content on the layer below. You
can use any of the drawing tools to create your mask.
1. | Select the Rectangle tool.
|
2. | Choose any color for the Fill and no stroke for the Stroke.
|
3. | Select
the top Mask layer and draw a thin rectangle just off to the left of
the Stage. Make the height of the rectangle slightly larger than the
Stage.
|
4. | Right-click/Ctrl-click the rectangle and select Create Motion Tween.
|
5. | Flash asks to convert the rectangular shape to a symbol so you can apply a motion tween. Click OK.
The top layer becomes a Tween layer, and one second’s worth of frames is added to the Timeline.
|
6. | Insert the same number of frames in the bottom layer.
|
7. | Move the playhead to the last frame, frame 24.
|
8. | Select the Free Transform tool.
|
9. | Click on the rectangular symbol.
The free transform handles appear around the rectangular symbol.
|
10. | Hold
down the Alt/Option key and drag the right edge of the free transform
handle to expand the rectangle to cover the entire Stage.
The rectangle becomes wider at the last frame. The motion tween creates a
smooth animation of the rectangle growing wider and covering the Stage.
|
11. | To
see the effects of the Mask layer on its Masked layer, lock both
layers. Scrub the red playhead back and forth along the Timeline to see
how the motion tween uncovers the content in the bottom layer.
|
12. | Insert a new layer and rename it actionscript.
|
13. | Insert a keyframe at frame 24 of the actionscript layer and open the Actions panel.
|
14. | In the Script pane of the Actions panel, enter stop();.
|
15. | Choose Control > Test Movie > in Flash Professional.
As the motion tween proceeds in the Mask layer, more of the Masked layer
is revealed, creating a cinematic transition known as a wipe. If you
open 09_workingcopy.fla and choose Control > Test Movie > in Flash
Professional, and then click on the car movie clip, you’ll see that the
masking effect is preserved even as it is loaded into another Flash
movie.
|
Note
Flash does not recognize
different Alpha levels of a mask. For example, a mask drawn with a fill
at an Alpha value of 50% will still mask at 100%. However, with
ActionScript you can dynamically create masks that will allow
transparencies. Masks also do not recognize strokes.