Publishers of technology books, eBooks, and videos for creative people

Home > Articles > Design > Adobe Creative Suite

This chapter is from the book

Animated and Complex Masks

Masking is a simple way to reveal portions of the layer or layers below it selectively. This technique requires making one layer a mask layer and the layers below it the masked layers.

By adding tweening to either or both the mask layer and the masked layers, you can go beyond simple, static peepholes and create masks that move, change shape, and reveal moving images. Use animated masks to achieve such complex effects as moving spotlights, magnifying lenses that enlarge underlying pictures, or "x-ray" types of interactions that show more detail within the mask area. Animated masks are also useful for creating cinematic transitions such as wipes, in which the first scene is covered as a second scene is revealed; and iris effects, in which the first scene collapses in a shrinking circle, leaving a second scene on the screen.

Inserting layers above and below masks can add even more complexity to animated masks. A shape filled with an alpha gradient, for example, can make the hard edges of a mask fade out slowly for a subtle spotlight.

Using movie clips in mask layers opens even more possibilities: multiple masks, masks that move on a motion guide, and even dynamically generated masks that respond to the user. Because dynamic masks rely on ActionScript, however, I'll discuss them in detail in Chapter 7.

To tween the mask layer:

  1. In Layer 1, create a background image or import a bitmap.

  2. Insert a new layer above the first layer.

  3. Select the top layer, and choose Modify > Layer.

  4. Select Mask Type.

  5. Select the bottom layer, and choose Modify > Layer.

  6. Select Masked Type. The top layer becomes the mask layer, and the bottom layer becomes the masked layer (Figure 1.58).

    Figure 1.58Figure 1.58 Layer 2 is the mask layer, and Layer 1 is the masked layer.

  7. Create a shape tween or a motion tween in the mask layer (the top layer) (Figure 1.59).

    Figure 1.59Figure 1.59 A shape tween of a moving vertical swirl is on the mask layer. The diver image is on the masked layer.

  8. Insert sufficient frames into your masked layer to match the number of frames in the mask-layer tween.

  9. Lock both layers to see the effects of your animated mask on the image in the masked layer (Figure 1.60).

    Figure 1.60Figure 1.60 The shape tween uncovers the image of the diver. The portion of the mask that does not reveal the photo is the color of the Stage.

    Tips

    • Place duplicate images that vary slightly in a normal layer under both the mask and masked layers. This technique makes the animated mask act as a kind of filter that exposes the underlying image. Add a bright image in the masked layer and a dark version of the same image in a normal layer under the masked layer, for example. The mask becomes a spotlight on the image (Figure 1.61). Explore other duplicate-image combinations, such as a sharp and a blurry image, a grayscale and a color image, or an offset image (Figure 1.62).

      Figure 1.61Figure 1.61 The moving spotlight in the mask layer (spotlight) uncovers the stained-glass image in the masked layer (bitmap). A duplicate darker image resides in the bottom, normal layer (dark bitmap).


      Figure 1.62Figure 1.62 The moving vertical shapes in the mask layer (venetian blinds) uncover the image of bicyclists in the masked layer (bikers). A duplicate image in the bottom normal layer (bikers offset) is shifted slightly to create the rippling effect.

    • Place a tween of an expanding box in the mask layer that covers the Stage to simulate cinematic wipes between images (Figure 1.63).

      Figure 1.63Figure 1.63 The mask layer contains a large shape tween that covers the entire Stage. This technique creates a cinematic wipe between an image in the masked layer (image 1) and an image in the bottom, normal layer (image 2).

To tween the masked layer:

  1. Beginning with two layers, modify the top to be the mask layer and the bottom to be the masked layer.

  2. Draw a filled shape or shapes in the mask layer (Figure 1.64). This area becomes the area through which you see your animation on the masked layer.

    Figure 1.64Figure 1.64 The windshield shapes are in the mask layer called windshields. The drawing of the car interior is in a normal layer above the windshields layer.

  3. Create a shape tween or a motion tween in masked layers that pass under the shapes in the mask layer (Figure 1.65).

    Figure 1.65Figure 1.65 Several motion tweens in masked layers (tree, cow, ground, and sky) move under the windshield shapes in the mask layer.

  4. Lock both layers to see the effects of your animated masked layers as they show up behind your mask layer (Figure 1.66).

    Figure 1.66Figure 1.66 The images of the tree, cow, ground, and sky move under the mask, creating the illusion of the car's forward motion.

    Tip

    This approach is a useful alternative to using shape tweens to animate borders or similar types of objects that grow, shrink, or fill in. Imagine animating a fuse that shortens to reach a bomb (Figure 1.67). Create a mask of the fuse, and animate the masked layer to become smaller slowly, making it look like just the fuse is shortening (Figure 1.68). Other examples that could benefit from this technique include trees growing, pipes or blood vessels flowing with liquid, and text that appears by filling in with color. Just remember that Flash doesn't recognize strokes in the mask layer, so if you want to create thin lines in the mask layer, use fills only.

    Figure 1.67Figure 1.67 The fuse of a bomb shortens.


    Figure 1.68Figure 1.68 The bomb's fuse is a thin shape in the mask layer. The rectangular tween in the masked layer shrinks, making it appear as though the fuse is shortening.

In the mask layer, Flash sees all fills as opaque shapes, even if you use a transparent solid or gradient. As a result, all masks have hard edges. To create a softer edge, place a gradient with a transparent center either under or over the mask to hide the edges.

To create a soft-edged mask:

  1. Create a mask layer and a masked layer.

  2. Place or draw a background image in the masked layer.

  3. Draw an ellipse in the mask layer.

  4. Copy the ellipse.

  5. Insert a new layer between the mask layer and the masked layer. Your new layer will become a masked layer.

  6. Choose Edit > Paste in Place (Cmd-Shift-V for Mac, Ctrl-Shift-V for Windows). A new ellipse appears in the new masked layer, right under the ellipse in the top mask layer (Figure 1.69).

    Figure 1.69Figure 1.69 The same ellipse appears in both the mask layer (ellipse 1) and the top masked layer (ellipse 2). The image of the windsurfer is in the bottom masked layer (background).

  7. Fill the pasted ellipse with a radial gradient, defined with a transparent center to an opaque perimeter, in the same color as the Stage (Figure 1.70).

    Figure 1.70Figure 1.70 A radial gradient with a transparent center in the top masked layer.

  8. Lock all three layers to see the effects of the mask (Figure 1.71). The mask layer lets you see through an elliptical area. The top masked layer hides the edges of the ellipse by creating a gradual fade toward the center. The bottom masked layer holds the contents of your background image (Figure 1.72).

    Figure 1.71Figure 1.71 The resulting soft-edged mask.


    Figure 1.72Figure 1.72 The soft-edged mask is the combination of the mask in the top layer (mask layer), a radial gradient in the middle layer (top masked layer), and the background image in the bottom layer (bottom masked layer).

Animated and Complex Masks

Creating soft edges with radial transparent gradients works well with circular masks, but if the shapes of your masks are more complicated, you'll need to resort to customizing the fades of your edges.

To create a soft-edged mask with an irregular shape:

  1. Create a mask layer and a masked layer.

  2. Place or draw an image in the masked layer.

  3. Draw an irregular shape in the mask layer.

  4. Copy the shape.

  5. Insert a new masked layer between the mask layer and the first masked layer.

  6. Choose Edit > Paste in Place. Your irregular shape appears in the new masked layer right under the original shape in the top mask layer (Figure 1.73).

    Figure 1.73Figure 1.73 An irregular shape in the top masked layer above an image in the bottom masked layer.

  7. With the Oval or Rectangle tool, draw an outline around your shape (Figure 1.74).

    Figure 1.74Figure 1.74 An empty rectangle drawn around the irregular shape.

  8. Fill the area between your shape and the outline with the background color, and delete the fill in the original shape. Your complex shape is now the "hole" of a larger shape (Figure 1.75).

    Figure 1.75Figure 1.75 By filling the area between the shape and the rectangle and then deleting the shape, you create a hole.

  9. Select the entire shape, and choose Modify > Shape > Soften Fill Edges (Figure 1.76). The Soften Fill Edges dialog box appears (Figure 1.77). The Distance option determines the thickness of the soft edge. The Number of Steps option determines how gradual the transition from opaque to transparent will be. The Direction option determines which way the edge softening will take place.

    Figure 1.76Figure 1.76 Choose Modify > Shape > Soften Fill Edges.


    Figure 1.77Figure 1.77 The Soften Fill Edges dialog box.

  10. Enter the Distance (in pixels) and the Number of Steps, and choose Expand for the Direction. All the edges around your shape soften. Because the entire shape expands, the actual hole shrinks (Figure 1.78).

    Figure 1.78Figure 1.78 The softened edges expand into the Òhole,Ó where it is visible through the mask in the top mask layer.

  11. Lock all three layers to see the effects of the mask (Figure 1.79).

    Figure 1.79Figure 1.79 The soft edges of an irregular mask created with Modify > Shape > Soften Fill Edges.

Although Flash allows multiple masked layers under a single mask layer, you cannot have more than one mask layer affecting any number of masked layers (Figure 1.80). To create more than one mask, you must use movie clips. Why would you need to have multiple masks? Imagine creating an animation that has two spotlights moving independently on top of an image (Figure 1.81). Because the two moving spotlights are tweened, they have to be on separate layers. The solution is to incorporate the two moving spotlights into a movie clip and place the movie clip on the mask layer.

Figure 1.80Figure 1.80 Layer 1 and Layer 2 are both defined as mask layers, but only Layer 2 affects Layer 3—the masked layer.


Figure 1.81Figure 1.81 Two independent spotlights moving, each uncovering portions of the image.

You will learn much more about the movie clip in chapters 4 and 7. If you'd like, skip ahead to read about movie clips and return when you feel comfortable.

To create multiple masks:

  1. Create a mask layer and a

  2. Place your image on the

  3. Choose Insert > New Symbol for Mac, Ctrl-F8 for Windows) The Create New Symbol appears.

  4. Enter a descriptive name Movie Clip (Figure 1.82); then click OK.

    Figure 1.82Figure 1.82 Choose Movie Clip to create a new movie-clip symbol.

    Flash creates a movie-clip symbol, and you enter symbol-editing mode for that symbol.

  5. Create two motion tweens of spotlights moving in different directions on the Timeline of your movie-clip symbol (Figure 1.83).

    Figure 1.83Figure 1.83 The two moving spotlights are motion tweens inside the movie clip called myMaskMovieClip.

  6. Return to the main Stage, and drag and instance of your movie-clip symbol into the mask layer (Figure 1.84).

    Figure 1.84Figure 1.84 An instance of the myMaskMovieClip movie clip is in the top (mask) layer, and the image of the bikers is in the bottom (masked) layer.

  7. Choose Control > Test Movie to see the effects of the movie-clip mask. The two motion tweens inside the movie clip both mask the image on the masked layer.

    Tips

    • To see what your masks are uncovering, use a transparent fill or choose the Outlines option in your Layers Properties (Figure 1.85).

      Figure 1.85Figure 1.85 Viewing your masks as outlines lets you see the image underneath; choose the Outlines option in the Layers Properties dialog box, or click the Show as Outlines icon in your layer.

    • To prevent the animation inside the movie clip from looping constantly, add a keyframe to its last frame and also add a Stop action.

Putting a movie-clip instance inside the mask layer not only makes multiple masks possible, but also provides a way to have a mask follow a motion guide. Build your tween that follows a motion guide inside a movie clip. Place that movie clip in a mask layer on the main Stage, and voilà—you have a mask that follows a path.

To guide a mask on a path:

  1. Create a mask layer and a masked layer.

  2. Place your image on the masked layer (Figure 1.86).

    Figure 1.86Figure 1.86 The words of this interesting question and a background fill are put on the bottom (masked) layer.

  3. Create a new movie-clip symbol.

  4. Inside your movie-clip symbol, create a motion tween that follows a motion guide (Figure 1.87).

    Figure 1.87Figure 1.87 Inside a movie clip, the flower graphic instance follows a motion path.

  5. Return to the main Stage, and drag an instance of your movie clip into the mask layer (Figure 1.88).

    Figure 1.88Figure 1.88 The movie clip containing the moving flower is in the mask layer and positioned over the words.

  6. Edit the motion path to get it exactly the way you want, relative to the other graphics on the Stage, by choosing Edit > Edit in Place or double-clicking the instance (Figure 1.89). Flash grays out all graphics except for the instance you are editing.

    Figure 1.89Figure 1.89 Edit in Place allows you to make changes in your movie-clip symbol and see the graphics on the main Stage at the same time.

  7. Choose Control>Test Movie to see the effect of your movie clip on the mask layer. The animation follows its path in the motion guide, and at the same time, it masks the image in the masked layer on the main Stage (Figure 1.90).

    Figure 1.90Figure 1.90 The moving flower exposes the question as it moves along its motion path.

Peachpit Promotional Mailings & Special Offers

I would like to receive exclusive offers and hear about products from Peachpit and its family of brands. I can unsubscribe at any time.

Overview


Pearson Education, Inc., 221 River Street, Hoboken, New Jersey 07030, (Pearson) presents this site to provide information about Peachpit products and services that can be purchased through this site.

This privacy notice provides an overview of our commitment to privacy and describes how we collect, protect, use and share personal information collected through this site. Please note that other Pearson websites and online products and services have their own separate privacy policies.

Collection and Use of Information


To conduct business and deliver products and services, Pearson collects and uses personal information in several ways in connection with this site, including:

Questions and Inquiries

For inquiries and questions, we collect the inquiry or question, together with name, contact details (email address, phone number and mailing address) and any other additional information voluntarily submitted to us through a Contact Us form or an email. We use this information to address the inquiry and respond to the question.

Online Store

For orders and purchases placed through our online store on this site, we collect order details, name, institution name and address (if applicable), email address, phone number, shipping and billing addresses, credit/debit card information, shipping options and any instructions. We use this information to complete transactions, fulfill orders, communicate with individuals placing orders or visiting the online store, and for related purposes.

Surveys

Pearson may offer opportunities to provide feedback or participate in surveys, including surveys evaluating Pearson products, services or sites. Participation is voluntary. Pearson collects information requested in the survey questions and uses the information to evaluate, support, maintain and improve products, services or sites; develop new products and services; conduct educational research; and for other purposes specified in the survey.

Contests and Drawings

Occasionally, we may sponsor a contest or drawing. Participation is optional. Pearson collects name, contact information and other information specified on the entry form for the contest or drawing to conduct the contest or drawing. Pearson may collect additional personal information from the winners of a contest or drawing in order to award the prize and for tax reporting purposes, as required by law.

Newsletters

If you have elected to receive email newsletters or promotional mailings and special offers but want to unsubscribe, simply email ask@peachpit.com.

Service Announcements

On rare occasions it is necessary to send out a strictly service related announcement. For instance, if our service is temporarily suspended for maintenance we might send users an email. Generally, users may not opt-out of these communications, though they can deactivate their account information. However, these communications are not promotional in nature.

Customer Service

We communicate with users on a regular basis to provide requested services and in regard to issues relating to their account we reply via email or phone in accordance with the users' wishes when a user submits their information through our Contact Us form.

Other Collection and Use of Information


Application and System Logs

Pearson automatically collects log data to help ensure the delivery, availability and security of this site. Log data may include technical information about how a user or visitor connected to this site, such as browser type, type of computer/device, operating system, internet service provider and IP address. We use this information for support purposes and to monitor the health of the site, identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents and appropriately scale computing resources.

Web Analytics

Pearson may use third party web trend analytical services, including Google Analytics, to collect visitor information, such as IP addresses, browser types, referring pages, pages visited and time spent on a particular site. While these analytical services collect and report information on an anonymous basis, they may use cookies to gather web trend information. The information gathered may enable Pearson (but not the third party web trend services) to link information with application and system log data. Pearson uses this information for system administration and to identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents, appropriately scale computing resources and otherwise support and deliver this site and its services.

Cookies and Related Technologies

This site uses cookies and similar technologies to personalize content, measure traffic patterns, control security, track use and access of information on this site, and provide interest-based messages and advertising. Users can manage and block the use of cookies through their browser. Disabling or blocking certain cookies may limit the functionality of this site.

Do Not Track

This site currently does not respond to Do Not Track signals.

Security


Pearson uses appropriate physical, administrative and technical security measures to protect personal information from unauthorized access, use and disclosure.

Children


This site is not directed to children under the age of 13.

Marketing


Pearson may send or direct marketing communications to users, provided that

  • Pearson will not use personal information collected or processed as a K-12 school service provider for the purpose of directed or targeted advertising.
  • Such marketing is consistent with applicable law and Pearson's legal obligations.
  • Pearson will not knowingly direct or send marketing communications to an individual who has expressed a preference not to receive marketing.
  • Where required by applicable law, express or implied consent to marketing exists and has not been withdrawn.

Pearson may provide personal information to a third party service provider on a restricted basis to provide marketing solely on behalf of Pearson or an affiliate or customer for whom Pearson is a service provider. Marketing preferences may be changed at any time.

Correcting/Updating Personal Information


If a user's personally identifiable information changes (such as your postal address or email address), we provide a way to correct or update that user's personal data provided to us. This can be done on the Account page. If a user no longer desires our service and desires to delete his or her account, please contact us at customer-service@informit.com and we will process the deletion of a user's account.

Choice/Opt-out


Users can always make an informed choice as to whether they should proceed with certain services offered by Adobe Press. If you choose to remove yourself from our mailing list(s) simply visit the following page and uncheck any communication you no longer want to receive: www.peachpit.com/u.aspx.

Sale of Personal Information


Pearson does not rent or sell personal information in exchange for any payment of money.

While Pearson does not sell personal information, as defined in Nevada law, Nevada residents may email a request for no sale of their personal information to NevadaDesignatedRequest@pearson.com.

Supplemental Privacy Statement for California Residents


California residents should read our Supplemental privacy statement for California residents in conjunction with this Privacy Notice. The Supplemental privacy statement for California residents explains Pearson's commitment to comply with California law and applies to personal information of California residents collected in connection with this site and the Services.

Sharing and Disclosure


Pearson may disclose personal information, as follows:

  • As required by law.
  • With the consent of the individual (or their parent, if the individual is a minor)
  • In response to a subpoena, court order or legal process, to the extent permitted or required by law
  • To protect the security and safety of individuals, data, assets and systems, consistent with applicable law
  • In connection the sale, joint venture or other transfer of some or all of its company or assets, subject to the provisions of this Privacy Notice
  • To investigate or address actual or suspected fraud or other illegal activities
  • To exercise its legal rights, including enforcement of the Terms of Use for this site or another contract
  • To affiliated Pearson companies and other companies and organizations who perform work for Pearson and are obligated to protect the privacy of personal information consistent with this Privacy Notice
  • To a school, organization, company or government agency, where Pearson collects or processes the personal information in a school setting or on behalf of such organization, company or government agency.

Links


This web site contains links to other sites. Please be aware that we are not responsible for the privacy practices of such other sites. We encourage our users to be aware when they leave our site and to read the privacy statements of each and every web site that collects Personal Information. This privacy statement applies solely to information collected by this web site.

Requests and Contact


Please contact us about this Privacy Notice or if you have any requests or questions relating to the privacy of your personal information.

Changes to this Privacy Notice


We may revise this Privacy Notice through an updated posting. We will identify the effective date of the revision in the posting. Often, updates are made to provide greater clarity or to comply with changes in regulatory requirements. If the updates involve material changes to the collection, protection, use or disclosure of Personal Information, Pearson will provide notice of the change through a conspicuous notice on this site or other appropriate way. Continued use of the site after the effective date of a posted revision evidences acceptance. Please contact us if you have questions or concerns about the Privacy Notice or any objection to any revisions.

Last Update: November 17, 2020