Recipe 6.8. Masking Page ElementsProblemYou want to block or reveal one or more elements using another element. SolutionCreate a mask. DiscussionYou can use masks to hide and reveal contents of one or more layers using the contents of another layer. Every working mask has two parts: the mask element(s), whose outline reveals the contents of the masked element(s), and the masked element(s), which is hidden except where it lies directly beneath the mask. Reflecting this distinction, Flash enables you to create special mask and masked layers, which hold mask and masked elements, respectively. A mask layer is a special kind of layer, like a motion guide layer, whose stage contents are not shown in the SWF, but rather are used to reveal whatever is placed beneath them in masked layers. Where the stage is empty in a mask layer, all content in the masked layer is hidden. To create a mask, follow these steps:
When you release, the masked layer will be indented beneath the mask layer, and both layers will have special blue mask icons beside them.
You can preview masks in the authoring environment by locking all layers that are a part of the mask group, including the mask and masked layers. You can lock layers one at a time by clicking the Lock Layer modifier for each layer. Alternatively, you can right-click (Windows) or Control-click (Macintosh) any layer in a mask group and select Show Masking, which toggles all the layers in the mask group to the locked position. To edit any part of a mask, unlock the affected layer. In addition to the basic features just outlined, Flash masks have a few features and limitations:
One popular effect is the text mask, in which text appears to be filled with a bitmap photo or some other type of advanced fill. This effect is easily achieved by placing text in its own layer, converting the layer to a mask layer, and placing a bitmap, gradient, or other image in a masked layer. You can remove a layer from a mask group by dragging it out of the influence of the mask layer, or by selecting it and choosing Modify Layer and choosing Normal as the layer type. See AlsoRecipe 6.3 |
Tripod >> 3pod Tips & Learning and manuals for educations