6. Animating Shapes and Using Masks


Lesson Overview

In this lesson, you’ll learn how to do the following:

Animate shapes with shape tweens

Use shape hints to refine shape tweens

Shape tween gradient fills

View onion skin outlines

Apply easing to shape tweens

Create and use masks

Understand mask limitations

Animate the Mask and Masked layers

Image

This lesson will take approximately 2½ hours to complete. Download the project files for this lesson from the Registered Products tab on your Account page at www.peachpit.com (click the Access Bonus Content link) and store them on your computer in a convenient location, as described in the Getting Started section of this book. Your Account page is also where you’ll find any updates to the lessons or to the lesson files.


Two overlapping Timeline panels on Animate.

You can easily morph—create organic changes in shape—with shape tweens. Masks provide a way to selectively show only parts of a layer. Together, they allow you to add more sophisticated effects to your animations.

Getting Started

You’ll start the lesson by viewing the animated logo that you’ll create as you learn about shape tweens and masks in Adobe Animate CC.

1. Double-click the 06End.html file in the Lesson06/06End folder to play the animation in a browser.

Screenshot shows the following text: Fire starter with teardrop-shaped flame above the alphabet “i."

The project is an animation of a flame flickering at the top of a fictional company name. Not only does the shape of the flame change constantly, but so does the radial gradient fill inside the flame. A linear gradient sweeps across the letters of the company name from left to right. In this lesson, you’ll animate both the flame and the colors that move across the letters.

2. Close your browser. Double-click the 06Start.fla file in the Lesson06/06Start folder to open the initial project file in Animate.

3. Choose File > Save As. Name the file 06_workingcopy.fla and save it in the 06Start folder. Saving a working copy ensures that the original start file will be available if you want to start over.


Image Note

If you have not already downloaded the project files for this lesson to your computer from your Account page, make sure to do so now. See Getting Started at the beginning of the book.


Animating Shapes

In the previous two lessons, you learned to create animations with symbol instances. You could animate the motion, scale, rotation, color effect, or the filters applied to symbol instances. However, you couldn’t animate the actual contours of a graphic. For example, creating an animation of the undulating surface of the ocean or the slithering motion of a snake’s body is difficult—if not impossible—with motion tweens. To do something more organic, you have to use shape tweening.

Shape tweening is a technique for interpolating stroke and fill changes between different keyframes. Shape tweens make it possible to smoothly morph one shape into another. Any kind of animation that requires the stroke or the fill of a shape to change—for example, animation of clouds, water, or fire—is a perfect candidate for shape tweening.

Because shape tweening applies only to shapes, you can’t use groups, symbol instances, or bitmap images.

Understanding the Project File

The 06Start.fla file is an ActionScript 3.0 document that contains most of the graphics already completed and organized in different layers. However, the file is static, and you’ll add the animation.

The text layer is at the very top and contains the company name, “Firestarter.” The flame layer contains the flame, and the bottom layer, called glow, contains a radial gradient to provide a soft glow.

The Timeline panel lists the following three layers: text (highlighted), flame, glow. Playhead is placed on "frame 1" on all three layers.

There are no assets in the library.

Creating a Shape Tween

To create the flickering flame effect, you’ll animate the undulating changes in a flame’s typical teardrop shape. You’ll rely on shape tweening to handle the smooth morphing from one shape to the next, as well as the gradual shifts in color. A shape tween requires at least two keyframes on the same layer. The beginning keyframe contains a shape drawn with the drawing tools in Animate or imported from Adobe Illustrator. The ending keyframe also contains a shape. A shape tween interpolates the smooth changes between the beginning keyframe and the end keyframe.

Establish keyframes containing different shapes

In the following steps, you’ll animate the flame that will sit on top of the company name.

1. Select frame 40 for all three layers.

A pointer selects and highlights “frame 40” on all layers. The layer “glow” is highlighted.

2. Choose Insert > Timeline > Frame (F5).

Frames are added to all three layers up to frame 40 to define the overall length of the animation.

The layer “text” and “frame 40” for all three layers are highlighted. The playhead is placed on "frame 40."

3. Lock the text layer and the glow layer. This prevents you from accidentally selecting or moving the graphics in those layers.

4. After making sure that none of the frames is selected, right-click frame 40 in the flame layer and select Insert Keyframe, or choose Insert > Timeline > Keyframe (F6). The contents of the previous keyframe in frame 1 are copied into the new keyframe.

You now have two keyframes on the Timeline in the flame layer, at frame 1 and at frame 40. Next, you’ll change the shape of the flame in the end keyframe.

The layer “flame” and “frame 40” in "flame" are highlighted. Keyframes are placed on the following positions: text—40, flame—39, glow—40.

5. Choose the Selection tool.

6. Click away from the shape to deselect it. Move your cursor close to the outlines of the shape and drag the contours of the flame to make the flame skinnier.

The Selection tool points at tip of the flame and illustrates the thinning of the flame.

The beginning keyframe and the end keyframe now contain different shapes—a fat flame in the beginning keyframe, and a skinny flame in the end keyframe in frame 40.

Apply the shape tween

Next, you’ll apply a shape tween between the keyframes to create the smooth transitions.

1. Click any frame between the beginning keyframe and the end keyframe in the flame layer.

2. Right-click and select Create Shape Tween. Or, from the Insert menu choose Shape Tween.

The layer “flame” is highlighted and lists four options at "frame 3": Create Motion Tween, Create Shape Tween (highlighted and pointed by an arrow), Create Classic Tween, Convert to Frame-by-Frame Animation. A playhead is placed at "frame 3."

Flash applies a shape tween between the two keyframes, which is indicated by a black forward-pointing arrow and a green fill in the tween span.

The layer “flame” and the corresponding keyframe scale are highlighted. A forward-pointing arrow spans from “frame 1” to “frame 40” with a playhead at "frame 40."

3. Watch your animation by choosing Control > Play (Enter/Return), or by clicking the Play button at the bottom of the Timeline.

Screenshot shows the text: Fire with an animated teardrop-shaped flame above the alphabet "i."

You have created a smooth animation between the keyframes in the flame layer, morphing the shape of the first flame into the shape of the second flame.


Image Note

Don’t worry if your flame doesn’t morph exactly the way you want it to. Small changes between keyframes work best. Your flame may rotate while going from the first shape to the second. You’ll have a chance to refine the shape tweening later in this lesson with shape hints.


Changing the Pace

The keyframes of a shape tween can be easily moved along the Timeline in order to change the timing or pacing of the animation.

Moving a keyframe

The flame slowly transforms from one shape to another over a period of 40 frames. If you want the flame to make the shape change more rapidly, you need to move the keyframes closer together.

1. Select the last keyframe of the shape tween in the flame layer.

A pointer selects and highlights “frame 40” on layer "flame."

2. Drag the last keyframe to frame 6.

The shape tween shortens.

A forward-pointing arrow spans from "frame 1" to "frame 5" on layer "flame." An arrow points to and selects "frame 6." A playhead is placed at "frame 6."

3. Press Enter/Return to play your animation.

The flame flickers quickly, and then remains static until frame 40.

Adding More Shape Tweens

You can add shape tweens by creating more keyframes. Each shape tween simply requires two keyframes to define its beginning state and its end state.

Insert additional keyframes

You want the flame to continually change shape, just like a real flame would. You’ll add more keyframes throughout the animation and apply shape tweens between all the keyframes.

1. Right-click frame 17 in the flame layer and choose Insert Keyframe. Or, choose Insert > Timeline > Keyframe (F6).

The contents of the previous keyframe are copied into the second keyframe.

Frames are placed at "frame 16 (highlighted)" and "frame 40" on layer "flame." The playhead is placed at "frame 16."

2. Right-click frame 22 in the flame layer and choose Insert Keyframe (F6).

The contents of the previous keyframe are copied into the new keyframe.

Frames are placed at "frame 16," "frame 22 (highlighted)," and "frame 40" from the previous example. The playhead is placed at "frame 22."

3. Continue inserting keyframes at frames 27, 33, and 40.

New frames are added at "frame 27" and "frame 33." The playhead is placed at "frame 40."

Your Timeline now has seven keyframes in the flame layer, with a shape tween between the first and second keyframes.

4. Move the red playhead to frame 17.

The playhead is placed at "frame 16" now.

5. Choose the Selection tool.

6. Click away from the shape to deselect it. Drag the contours of the flame to create another variation in its shape. You can make the base thicker, or change the curvature of the tip to make it lean left or right.

Screenshot shows the following text: Fire with a teardrop-shaped flame above "i". The Selection tool at the tip illustrates the curving of the shape.

7. Modify the flame shapes in each of the newly inserted keyframes to create subtle variations.

Seven different teardrop-shaped flames with different curves at the tip of each flame are displayed on the preview panel. Arrows connect each flame to a keyframe on the layer "flame."

Extending the shape tweens

Your next step is to extend the shape tween so the flame morphs from one shape to the next.

1. Right-click any frame between the second and third keyframes and choose Create Shape Tween. Or choose Insert > Shape Tween.

Layer "flame" is highlighted under Timeline panel. The menu lists four options at "frame 8"

A black forward-pointing arrow on a green background appears between the two keyframes, showing that you’ve applied a shape tween.

Layer "flame" is highlighted under Timeline panel. Keyframes are placed at different timelines.

2. Continue to insert shape tweens between all the keyframes.

You should have six shape tweens in the flame layer.

Layer "flame" is highlighted under Timeline panel. Six forward-pointing arrows on highlighted background span on the timeline.

3. Press Enter/Return to watch the animation play.

Screenshot shows the completed animated teardrop-shaped flame.

Your flame flickers back and forth for the duration of the animation. Depending on how extensive your modifications to the flame have been, your flame may undergo some weird contortions between keyframes—for example, flipping or rotating unpredictably. Don’t worry! You’ll have a chance to refine your animation later in the lesson with shape hints.

Creating a Looping Animation

Your flame should flicker back and forth continuously for as long as the logo is onscreen. You can create a seamless loop by making the first and last keyframe identical, and by putting the animation inside a movie clip symbol. A movie clip timeline loops continuously, independently of the main Timeline.

Duplicating keyframes

Make the first keyframe identical to the last keyframe by duplicating its contents.

1. Right-click the first keyframe on the flame layer and select Copy Frames. Or choose Edit > Timeline > Copy Frames.

Highlighted layer "flame" lists the following options at keyframe 1 to 5: Clear Keyframe, Convert to Keyframes, Convert to Blank Keyframes, Cut Frames, Copy Frames, Paste Frames, Clear Frames, Select All Frames. A pointer points to and highlights Copy Frames.

The contents of the first keyframe are placed on your clipboard.

2. Right-click the last keyframe on the flame layer and select Paste Frames. Or choose Edit > Timeline > Paste Frames.

Highlighted layer "flame" lists the following options at "frame 40": Clear Keyframe, Convert to Keyframes, Convert to Blank Keyframes, Cut Frames, Copy Frames, Paste Frames, Clear Frames, Select All Frames. Pointer points to and highlights Paste Frames.

The first and last keyframes now contain identical flame shapes.


Image Tip

You can quickly duplicate keyframes by first selecting a keyframe and then Alt/Option-dragging the keyframe to a new position.


Previewing the loop

Use the Loop button at the bottom of the Timeline to preview your animation.

1. Click the Loop button at the bottom of the Timeline, or choose Control > Loop Playback (Alt+Shift+L/Option+Shift+L) to enable continuous playback when you play the movie.

A circle highlights the Loop button at the bottom of the Timeline panel.

Markers appear on the Timeline header indicating the range of frames that loop during playback. Next, adjust the markers to extend the loop to include the entire movie.


Image Note

The Loop Playback option loops only in the Animate CC authoring environment, and not when it is published. To create a loop, put your animation in a movie clip symbol, or use a this.gotoAndPlay() command for ActionScript 3.0 documents or for an HTML5 Canvas document, as described in the later lessons on interactivity.


2. Extend the markers to include all the frames on your Timeline (frames 1 through 40), or click the Modify Markers button and choose Marker Range All.

A circle highlights and labels the Modify Markers at the bottom of the Timeline panel.
Six forward-pointing arrows on highlighted background spans on the following keyframes: 1 to 5, 5 to 16, 16 to 21, 21 to 26, 26 to 32, and 32 to 40. A playhead is placed at keyframe 40.

3. Press Enter/Return to test the animation.

The flame animation plays and loops continuously. Click the Pause button or press Enter/Return again to stop the animation.

Inserting the animation into a movie clip

When your animation plays in a movie clip symbol, the animation loops automatically.

1. Select all the frames on the flame layer, and right-click and choose Cut Frames. Or, choose Edit > Timeline > Cut Frames.

Layer "flame" and the corresponding keyframes are highlighted. The menu lists options on the highlighted area.

The keyframes and shape tweens are removed from the Timeline and placed on the clipboard.

2. Choose Insert > New Symbol (Ctrl+F8/Command+F8).

The Create New Symbol dialog box appears.

3. Enter flame as the name of the symbol, and choose Movie Clip as the Type. Click OK.

The Create New Symbol dialog box shows: Name: flame, Type: Movie Clip, Folder: Library root, Advanced Settings.

A new movie clip symbol is created and opens in symbol-editing mode.

4. Right-click the first frame on your movie clip timeline and select Paste Frames. Or, choose Edit > Timeline > Paste Frames.

A new layer "Layer 1" is created and highlighted under Timeline panel.

The flame animation from the main Timeline is pasted into your movie clip symbol’s timeline.

Layer "flame" is highlighted under Timeline panel. Six forward-pointing arrows on highlighted background spans on the different keyframes.

5. Click the Scene 1 button on the Edit bar at the top of the Stage, or choose Edit > Edit Document (Ctrl+E/Command+E).

You exit symbol-editing mode and return to the main Timeline.

6. Select the flame layer, which is currently empty. Drag your newly created flame movie clip symbol from the Library panel to the Stage.

An instance of the flame movie clip symbol appears on the Stage.

The Library panel shows the selected sections as a single bitmap image in its preview pane.

7. Choose Control > Test (Ctrl+Enter/Command+Return).

Flash exports the SWF in a new window, where you can preview the animation. The flame flickers continuously in a seamless loop.

Using Shape Hints

Animate CC creates the smooth transitions between keyframes of your shape tween, but sometimes the results are unpredictable. Your shapes may go through strange contortions, flips, and rotations to get from one keyframe to another. You may like the effect, but more often than not, you’ll want to maintain control of the transformations. Using shape hints can help refine the shape changes.

Shape hints force Animate to map points on the start shape to corresponding points on the end shape. By placing multiple shape hints, you can control more precisely how a shape tween appears.

Adding shape hints

Now you’ll add shape hints to the shape of the flame to modify the way it morphs from one shape to the next.

1. Double-click the flame movie clip symbol in the library to enter symbol-editing mode. Select the first keyframe of the shape tween in the flame layer.

The Library panel shows the flame at "frame1"

2. Choose Modify > Shape > Add Shape Hint (Ctrl+Shift+H/Command+Shift+H).

A red circled letter “a” appears on the Stage. The circled letter represents the first shape hint.

3. Choose the Selection tool and make sure that Snap To Objects is selected.

The magnet icon at the bottom of the Tools panel should be depressed. Snap To Objects ensures that objects snap to each other when being moved or modified.

Alphabet "a" is marked in red circle at the center of the teardrop-shaped flame.

4. Drag the circled letter to the tip of the flame.

"a" is now marked at the tip of the teardrop-shaped flame.

Image Tip

Shape hints should be placed on the edges of shapes.


5. Choose Modify > Shape > Add Shape Hint again to create a second shape hint.

A red-circled “b” appears on the Stage.

6. Drag the “b” shape hint to the bottom of the flame shape.

Two teardrop-shaped flames are marked as follows: "a" at the tip and "b" at the center of the first flame. "a" at the tip and "b" at the bottom of the second flame in red circles.

You have two shape hints mapped to different points on the shape in the first keyframe.

7. Select the next keyframe of the flame layer (frame 6).

A corresponding red-circled “b” appears on the Stage, hiding an “a” shape hint that is directly under it.

The center of the flame is marked as "b." The playhead is placed at "frame 6."

8. Drag the circled letters to corresponding points on the shape in the second keyframe. The “a” hint goes on the top of the flame, and the “b” hint goes on the bottom of the flame.

The shape hints turn green, indicating that you’ve correctly placed the shape hint.

The tip of flame is marked as "a" and the bottom as "b" in green circle.

9. Select the first keyframe.

Note that the initial shape hints have turned yellow, indicating that they are correctly placed. The shape hints in the beginning keyframe turn yellow and those in the ending keyframe turn green when placed properly.

The tip of flame is marked as "a" and the bottom as "b" in yellow circle.

10. Scrub the playhead through the first shape tween on the Timeline to see the effect of the shape hints on the shape tween.

The shape hints force the tip of the flame in the first keyframe to map to the tip of the flame in the second keyframe and the bottoms to map to each other. This restricts the transformations.

To demonstrate the value of shape hints, you can deliberately create a mess of your shape tweens. In the end keyframe, put the “b” hint at the top of the flame and the “a” hint at the bottom.

Two teardrop-shaped flames are marked as following: the tip of flame 1 as "a" and the bottom as "b" in yellow circle. The tip of flame 2 as "b" and the bottom as "a" in a green circle illustrating the beginning and end of two frames.

Animate forces the tip of the flame to tween to the bottom of the flame, and vice versa. The result is a strange flipping motion as Animate tries to make the transformation. Put the “a” back at the top and the “b” back at the bottom after you’re done experimenting.


Image Tip

You can add a maximum of 26 shape hints to any shape tween. Be sure to add them consistently in a clockwise or counterclockwise direction for best results.


Removing shape hints

If you’ve added too many shape hints, you can easily delete the unnecessary ones. Removing a shape hint in one keyframe will remove its corresponding shape hint in the other keyframe.

Drag an individual shape hint entirely off the Stage and pasteboard.

Choose Modify > Shape > Remove All Hints to delete all the shape hints.

Only the content in the keyframes of a shape tween is displayed fully rendered. All other frames are shown as outlines. To see all frames fully rendered, use onion skinning, as described in the next exercise.

Previewing Animations with Onion Skinning

It’s sometimes useful to see how your shapes are changing from one keyframe to another on the Stage all at once. Seeing how the shapes gradually change lets you make smarter adjustments to your animation. You can do so using the onion skinning option, available at the bottom of the Timeline.

Onion skinning shows the contents of the frames before and after the currently selected frame.

The term “onion skin” comes from the world of traditional hand-drawn animation, in which animators draw on thin, semitransparent tracing paper known as onionskin. A light box shines a light behind the drawings to help see them through several sheets. When creating an action sequence, animators flip back and forth quickly between drawings held between their fingers. This allows them to see how the drawings smoothly connect to each other.

Turning on onion skinning

There are two modes for onion skinning—onion skin and onion skin outlines. Although both show previous and future frames, onion skin displays graphics fully rendered whereas onion skin outlines shows only the outlines of your graphics. In this task, you’ll use onion skin outlines.

1. Click the Onion Skin Outlines button at the bottom of the Timeline.

A circle highlights the Onion Skin Outlines button at the bottom of the Timeline panel.

Animate shows several outlines of the flame, with the currently selected frame in red. The previous two frames are shown in blue and the future two frames are shown in green. The outlines of flame fade the further away it is from the current frame.

An outline of a teardrop-shaped flame shows multiple tips of different shades. Arrows point to and label the tips as follows: First tip as Past frames, center tip as Current frame, last tip as Future frames.

On the Timeline, Animate displays markers to bracket your currently selected frame. The blue-marked bracket (to the left of the playhead) indicates how many previous frames are shown on the Stage, and the green-marked bracket (to the right of the playhead) indicates how many future frames are shown.

Brackets marked in blue and green respectively on the left and on the right enclose "frame 8" to "frame 12." A playhead is placed on "frame 10."

2. Move the playhead to a different frame.

Animate keeps the markers around the playhead no matter where you move it, always showing the same number of frames behind and ahead.

3. Click the Onion Skin button at the bottom of the Timeline.

A circle highlights the Onion Skin button at the bottom of the Timeline panel.

Onion skinning switches from outline mode to the standard onion skin mode, showing the onion skins of your flame fully rendered. The flames from previous frames are tinted blue, and the flames from future frames are tinted green.

A teardrop-shaped flame shows multiple tips of different shades.

Image Tip

You can even scrub the playhead back and forth along the Timeline to see the ghostly images of the onion skins moving along with the animation. You cannot see onion skins during normal playback, however.


Adjusting the markers

You can move either marker to show more or fewer onion skin frames.

Drag the blue marker to adjust the number of past onion skin frames shown.

A double-headed arrow is on the left bracket illustrating the dragging of frames to "frame 3". A playhead is placed on "frame 10."

Drag the green marker to adjust the number of future frames displayed.

Hold down the Ctrl/Command key while dragging either marker to move the past and future markers in equal amounts.

Hold down the Shift key while dragging either marker to move the onion skin range to a different spot on the Timeline (as long as it still encompasses the playhead).

Click the Modify Markers menu button to select a preset marker option. For example, you can choose Marker Range 2 or Marker Range 5 to have the markers show two or five frames in front and behind the current frame.

A circle highlights the Modify Markers button at the bottom of the Timeline panel.

Customizing onion skin colors

If you don’t like the green and blue color coding of previous and future frames, you can change them in the preferences.

1. Choose Edit > Preferences (Windows)/Animate CC > Preferences (Mac).

The Preferences dialog box appears.

2. In the Onion Skin Color section, click the color boxes for Past, Present, or Future to choose new colors.

The Preference dialog box. A circle highlights the different Onion Skin Colors.

Animating Color

Shape tweens interpolate all aspects of a shape, which means both the stroke and fill of a shape can be tweened. So far, you’ve modified the stroke, or outlines, of the flame. In the next section, you’ll modify the fill so that the color gradient can change—perhaps glow brighter and more intense at some points in the animation.

Adjusting the gradient fills

Use the Gradient Transform tool to change the way the color gradient is applied to a shape, and use the Color panel to change the actual colors used in a gradient.

1. If you’re not already in symbol-editing mode for your flame symbol, double-click the flame movie clip symbol in the library to edit it.

2. Select the second keyframe on the flame layer (frame 6).

3. Select the Gradient Transform tool, which is grouped with the Free Transform tool in the Tools panel.

The control points for the Gradient Transform tool appear on the gradient fill of the flame. The various control points allow you to stretch, rotate, and move the focal point of the gradient within the fill.

The Gradient Selection tool illustrating the stretching of the flame points to and labels the selected flame.

4. Use the control points to tighten the color gradient into the base of the flame. Reduce the gradient’s size, make it wider and positioned lower on the flame, and move the focal point (represented by a tiny triangle) of the gradient to one side.

The Gradient Selection tool is placed at the base of the flame from the previous example to illustrate concentration of yellow flame at a small section in the bottom.

Your flame’s orange core appears lower and more intense because the colors are distributed in a smaller area.

5. Move the playhead along the Timeline between the first and second keyframe.

The shape tween automatically animates the colors inside the flame as well as its contours.

6. Select the third keyframe on the flame layer (frame 17). In this frame, you’ll adjust the actual color of the gradient.

Playhead is placed on the third frame in the "flame" layer at "frame 16" in the Timeline panel.

7. Choose the Selection tool and click the fill of the flame on the Stage.

8. Open the Color panel (Window > Color).

The Color panel appears, showing you the gradient colors of the selected fill.

The Color Definition dialog box shows the gradient color: Radial gradient and Hex value: FFFF00 and a color bar at the bottom with "yellow flame" and "orange flame", and the color values .

9. Click the inner color marker, which is currently yellow.

10. Change the color to a hot pink (#F109EE).

The center color of the gradient turns pink.

The Hex value of the previous example is adjusted to F109EE.

11. Move the playhead along the Timeline between the second and third keyframes.

The shade of the flame is changed to dark pink.

The shape tween automatically animates the center color in the gradient from yellow to pink. Experiment with the other keyframes by modifying the gradient fill and see what kinds of interesting effects you can apply to your flickering flame.


Image Note

Shape tweens can smoothly animate solid colors or color gradients, but they can’t animate between different types of gradients. For example, you can’t shape tween a linear gradient into a radial gradient.


Creating and Using Masks

Masking is a way of selectively hiding and displaying content on a layer. It enables you to control the content that your audience sees. For example, you can make a circular mask and allow your audience to see only through the circular area so that you get a keyhole or spotlight effect. In Animate, you put a mask on one layer and the masked content in a layer below it.

For the animated logo you’re creating in this lesson, you’ll make the text a little more visually interesting by using the text itself as a mask.

Define the mask layer

You’ll create a mask from the “Fire starter” text that will reveal an image of a fire beneath it.

1. Return to the main Timeline. Unlock the text layer. Double-click the icon in front of the text layer name, or select the text layer and choose Modify > Timeline > Layer Properties.

The Layer Properties dialog box appears.

The Layer Properties dialog box shows the following properties: Name: text, Visibility: Visible (selected), Transparent: 50, Type: Mask, Outline color: purple, Layer height: 100%.

2. Select Mask and click OK.

The Type option in Layer properties dialog box shows the following options: Normal, Mask (selected), Masked, Folder, Guide.

The text layer becomes a mask layer, indicated by the mask icon in front of the layer name. Anything in this layer will act as a mask for a masked layer below it.

Timeline panel shows the mask icon in front of the layer "text."

For this lesson, we’re using the text already in place as the mask, but the mask can be any filled shape. The color of the fill doesn’t matter. What’s important to Animate 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 or text tools to create the fill for your mask.


Image Tip

Masks do not recognize strokes, so use only fills in the mask layer. Text created with the Text tool also works as a mask.



Image Note

Animate does not recognize different Alpha levels in a mask created on a timeline, so a semitransparent fill in the mask layer has the same effect as an opaque fill, and edges will always be hard. However, in an ActionScript 3.0 document, you can dynamically create masks that will allow transparencies with ActionScript code.


Create the masked layer

The masked layer is always under the mask layer.

1. Click the New Layer button, or choose Insert > Timeline > Layer.

A new layer appears.

2. Rename the layer fiery effect.

A new layer is added to the previous example and named as "fiery effect."

3. Drag the fiery effect layer under the mask layer (named “text”) and a little to the right so that it becomes indented.

The fiery effect layer becomes a masked layer, paired with the mask layer above it. Any content in the masked layer will be masked by the layer above it.

The layer "fiery effect" is placed beneath layer "text." A mask icon is present in front of layer "fiery effect."

Image Tip

You can also double-click a normal layer under a mask layer, or choose Modify > Timeline > Layer Properties, and select Masked to modify the layer into a masked layer.


4. Choose File > Import > Import To Stage, and select fire.jpg from the 06Start folder.

The bitmap image of fire appears on the Stage, and the words appear over the image.

The preview panel shows the text "Fire starter" with flames in the background.

See the effects of the mask

To see the effects of the mask layer on its masked layer, lock both layers.

1. Click the Lock option for both the text layer and the fiery effect layer.

A circle highlights the lock button for layers "text" and "fiery effect."

Both mask and masked layers become locked. The shapes of the letters in the mask layer reveal parts of the image in the masked layer.

The Stage shows the completed animation.

2. Choose Control > Test.

As the flame flickers above the text, the letters reveal the fiery texture in the layer below it.


Image Note

You can have multiple masked layers under a single mask layer.


Animating the Mask and Masked Layers

The letters of your animated logo have more drama now that you’ve created a mask with an image of fire behind it. However, the client for this fictional project now demands that it have even more punch. Although she likes the look of the fiery letters, she wants an animated effect.

Fortunately, you can include animations in either the mask or the masked layer. You can create an animation in the mask layer if you want the mask itself to move or expand to show different parts of the masked layer. Or, you can create an animation in the masked layer if you want the content to move under a mask, like scenery whizzing by a train window.

Adding a tween to the masked layer

To make the logo more compelling for your client, you’ll add a shape tween to the masked layer. The shape tween will move a glow from left to right for a portion of the movie under the letters.

1. Unlock both the text layer and the fiery effect layer.

The effects of the mask and masked layer are no longer visible, but their contents are now editable.

2. Delete the bitmap image of the fire in the fiery effect layer.

3. Choose the Rectangle tool and open the Color panel (Window > Color).

4. In the Color panel, make sure Fill Color is selected and choose Linear Gradient from the Color Type menu.

5. Create a gradient that starts with red on the left (#FF0000), yellow in the middle (#FFFC00), and red again on the right (#FF0000). Make sure your Alpha settings are at 100% so the colors are not transparent.

The Color Definition dialog box shows the gradient color: Linear gradient and Hex value: FFFF00 and a color bar at the bottom with "orange flame" and "yellow flame", and the color values .

6. Create a rectangle in the fiery effect layer that encompasses the letters in the text layer.

A pointer creates a rectangle around the text.

7. Choose the Gradient Transform tool and click the fill of your rectangle to select it.

The control handles for the Gradient Transform tool appear on the fill of the rectangle. We’ll use this tool to position the gradient off the Stage so it can make a dramatic entrance.

Gradient Transform tool is on the right border of the rectangle.

8. Drag the center point of the gradient so that the yellow color appears on the far left side of the Stage.

The Gradient Transform tool with a forward pointing arrow is at the left of the rectangle, at the beginning of the text.

The yellow glow will enter from the left and move to the right.

9. Right-click frame 20 in the fiery effect layer and choose Insert Keyframe (F6).

The contents of the previous keyframe are copied into the new keyframe.

"Frame 20" on "fiery effect" layer is highlighted. Playhead is at "frame 20."

10. Right-click the last frame (frame 40) in the fiery effect layer and choose Insert Keyframe (F6).

The contents of the keyframe at frame 20 are copied into the new keyframe. You now have three keyframes in the fiery effect layer.

"Frame 40" on "fiery effect" layer is highlighted. Keyframes are present at "frame 1" and "frame 20." Playhead is at "frame 40."

11. Make sure that your playhead is still in the last frame (frame 40).

12. Drag the center point of the gradient far enough to the right so that the yellow color is just barely visible on the right side of the Stage.

The Gradient Transform tool with a forward pointing arrow is at the right, outside the rectangle. A vertical line is at the end of the text inside the rectangle.

13. Right-click anywhere on the Timeline between the second and third keyframe in the fiery effect layer and select Create Shape Tween. Or, from the top menu, choose Insert > Shape Tween.

The color gradient is shape-tweened so the yellow glow moves within the fill of the rectangle from left to right.

The preview panel shows the text inside the rectangle. The background is separated in two different shades.

14. Watch your animation by choosing Control > Test.

While the flame burns above the letters, a soft yellow glow flashes across the letters.

A completed animation of the previous examples.

Easing a Shape Tween

Eases help your animation bear a sense of weight by enabling you to add an acceleration or deceleration component to its motion.

You add an ease to a shape tween in the Properties panel. Ease values range from −100, which indicates an ease-in, to 100, which indicates an ease-out. An ease-in makes the motion start off slowly. An ease-out slows down the motion as it approaches its end keyframe.


Image Note

The Motion Editor, which is the advanced panel integrated into the Timeline that provides different ease types, is not available for shape tweens.


Adding an ease-in

You’ll make the glow that flashes across the letters of the logo begin slowly, and then pick up speed. The ease-in will help viewers take notice of the animation before it proceeds.

1. Click anywhere inside the shape tween in the fiery effect layer.

2. In the Properties panel, enter -100 for the Ease value.

The Properties dialog box shows the Ease value as (minus) 100 in and Blend: Distributive for Tweening.

Animate applies an ease-in effect to the shape tween.

3. Make sure your mask and masked layers are locked, and choose Control > Test to test your movie.

The soft yellow glow flashes across the letters, starting off slowly, and then adding a little more sophistication to the entire animation.


Image Note

You can apply either an ease-in or an ease-out to a shape tween, but not both.


Review Questions

1. What is a shape tween, and how do you apply it?

2. What are shape hints, and how do you use them?

3. What does the color-coding of the onion skin markers indicate?

4. How is a shape tween different from a motion tween?

5. What is a mask, and how do you create one?

6. How do you see the effects of a mask?

Review Answers

1. A shape tween creates smooth transitions between keyframes containing different shapes. To apply a shape tween, create different shapes in an initial keyframe and in a final keyframe. Then, select any frame between the keyframes in the Timeline, right-click, and select Create Shape Tween.

2. Shape hints are labeled markers that indicate how one point on the initial shape of a shape tween will map to a corresponding point on the final shape. Shape hints help refine the way the shapes will morph. To use shape hints, first select the initial keyframe of a shape tween. Choose Modify > Shape > Add Shape Hint. Move the first shape hint to the edge of the shape. Move the playhead to the final keyframe, and move the corresponding shape hint to a matching edge of the shape.

3. By default, Animate shows the onion skins in previous frames in blue and the onion skins in future frames in green. The onion skin in the currently selected frame is in red. The colors can be customized in the Preferences panel.

4. A shape tween uses shapes, whereas a motion tween uses symbol instances. A shape tween smoothly interpolates the change of stroke or fill of a shape between two keyframes. A motion tween smoothly interpolates the changes in location, scale, rotation, color effect, or filter effect of a symbol instance between two keyframes.

5. Masking is a way of selectively hiding and displaying content on a layer. In Animate, you put a mask on the top mask layer and the content in the layer below it, which is called the masked layer. Both the mask and the masked layers can be animated.

6. To see the effects of the mask layer on the masked layer, you must lock both layers, or test your movie with Control > Test.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.223.134.29