28
4 Animation Basics The Timeline 71 Document Properties 72 Understanding Keyframes and Frames 74 Frame-by-Frame Animation with Keyframes 77 What Is the Frame Rate? 82 Recommended Frame Rates 82 Inserting and Deleting Frames 83 Copying and Reversing Frames 87 Using Onion Skinning 90 Testing Movies 95 Flash has a reputation as a powerful and robust animation tool. If you know other animation tools, such as Macromedia Director or Adobe After Effects, you might be looking for similarities. It’s actually easier to learn the animation capabilities of Flash 8 if you don’t know other anima- tion programs, because you have no preconceived notions of how you think it might work. This chapter introduces you to the Timeline, which plays a significant role in producing animations. The Timeline lets you work with keyframes, blank keyframes, frame-by-frame animation, and onion skinning. If these are new terms to you, they won’t be for long. This chapter also covers setting the frame rate (and how it affects playback speeds). By the end of this chapter, things should really get moving for you, all puns intended! Flash Professional 8 : HOT 70

Macromedia Flash Professional 8 Hands-On Training (ISBN 0 ...files.lynda.com/files/edu-media/EDU_HOT_CHAPTERS/... · In the Property Inspector , type 24 in the Frame rate field

  • Upload
    others

  • View
    5

  • Download
    1

Embed Size (px)

Citation preview

Page 1: Macromedia Flash Professional 8 Hands-On Training (ISBN 0 ...files.lynda.com/files/edu-media/EDU_HOT_CHAPTERS/... · In the Property Inspector , type 24 in the Frame rate field

4Animation Basics

The Timeline 71

Document Properties 72

Understanding Keyframes and Frames 74

Frame-by-Frame Animation with Keyframes 77

What Is the Frame Rate? 82

Recommended Frame Rates 82

Inserting and Deleting Frames 83

Copying and Reversing Frames 87

Using Onion Skinning 90

Testing Movies 95

Flash has a reputation as a powerful and robust animation tool. If you

know other animation tools, such as Macromedia Director or Adobe

After Effects, you might be looking for similarities. It’s actually easier to

learn the animation capabilities of Flash 8 if you don’t know other anima-

tion programs, because you have no preconceived notions of how you

think it might work.

This chapter introduces you to the Timeline, which plays a significant role

in producing animations. The Timeline lets you work with keyframes,

blank keyframes, frame-by-frame animation, and onion skinning. If these

are new terms to you, they won’t be for long. This chapter also covers

setting the frame rate (and how it affects playback speeds). By the end of

this chapter, things should really get moving for you, all puns intended!

Flash Professional 8 : H•O•T70

FL08_04 (070-097).qxd 11/29/05 3:11 PM Page 70

Page 2: Macromedia Flash Professional 8 Hands-On Training (ISBN 0 ...files.lynda.com/files/edu-media/EDU_HOT_CHAPTERS/... · In the Property Inspector , type 24 in the Frame rate field

Understanding and working withthe Timeline is essential to creatinganimations in Flash 8. This illustra-tion identifies the elements of theTimeline you’ll be working with inthis chapter.

The following chart describes the features in the Timeline.

71Chapter 4 : Animation Basics

The Timeline

Timeline Features

Feature Description

Keyframe Defines the moment in the Timeline when actions or animation changesoccur. Keyframe content remains unchanged until another keyframe or ablank keyframe occurs in the Timeline.

Playhead The playhead—a red rectangle with a long, red line—indicates the currentlyselected keyframe. Click and drag (or scrub) the playhead back and forth inthe Timeline to quickly preview your animation.

Blank keyframe You can either add content to blank keyframes or use them to intentionallybreak up or make changes to an animation.

Frame View menu Gives you several different options for changing the size and therefore thenumber of frames visible at one time in the Timeline. The default view,Normal, displays the frames at an appropriate size for most projects.However, when you start creating longer animations, you will need to set theFrame view to Small or Tiny, so you can see more frames at one time.

Layer stack Organizes the elements of an animation and controls the order in which theystack on top of each other. As a result, you can animate layers independent ofand in front of or behind other layers. Each layer has options for hiding orshowing the layer, locking it, and displaying its contents as outlines. You’lllearn more about layers in Chapter 5, “Shape Tweening.”

Current frame Displays the current position of the playhead and the frame number of thecurrently selected frame.

Frame rate Displays the number of frames per second (fps) at which the movie attemptsto play on the user’s browser or computer. Double-clicking the frame ratevalue is a quick way to access the Document Properties dialog box.

Elapsed time Displays the time elapsed from Frame 1 to the current playhead location atthe currently selected frame rate.

Current frame Frame rateLayer stack Elapsed time

Keyframe Playhead Frame View menuBlank keyframe

FL08_04 (070-097).qxd 11/29/05 3:11 PM Page 71

Page 3: Macromedia Flash Professional 8 Hands-On Training (ISBN 0 ...files.lynda.com/files/edu-media/EDU_HOT_CHAPTERS/... · In the Property Inspector , type 24 in the Frame rate field

The document properties are general specifications—such as Stage dimensions, background color, andframe rate—that affect your entire project. When you start a new project in Flash 8, you should set thedocument properties. Here’s an exercise to show you how.

Copy the chap_04 folder fromthe HOT CD-ROM to your Desktop.Choose File > New to create a newfile. Choose File > Save. In the Savedialog box, name the file movie.fla and save it in the chap_04 folder. Make sure the Property Inspectoris visible. If it’s not, choose Window > Properties.

Notice the following default document properties: the default Stage dimensions are 550 x 400 pixels, thedefault movie background is white, and the default frame rate is 12 frames per second. You’ll learn howto change each setting in the following steps.

In the Property Inspector, type 24 in the Frame rate field.

For every second of your animation, 24 frames play. You’ll learn more about frame rates in the next exercise.

In the Property Inspector, click the Background box to display the default color palette. Select a light blue to change the back-ground color of your movie.

In the Property Inspector, click the Size button to open theDocument Properties dialog box,which lets you give a title and briefdescription of your movie, as well asset frame rate preferences, moviedimensions, background color, and rule measurements for your entire movie.

4

3

2

1

72 Flash Professional 8 : H•O•T

1E X E R C I S E

Document Properties

FL08_04 (070-097).qxd 11/29/05 3:11 PM Page 72

Page 4: Macromedia Flash Professional 8 Hands-On Training (ISBN 0 ...files.lynda.com/files/edu-media/EDU_HOT_CHAPTERS/... · In the Property Inspector , type 24 in the Frame rate field

Type 700 in the width field and 350 in the height field.

These fields control the absolute pixel dimensions of the Stage. You will learn other ways to control the size of your movie in Chapter 17, “Publishing and Exporting.”

Click the Ruler units pop-up menu, which contains several ways to display the ruler units on your Stage. Leave this option set to the default—Pixels.

Click OK to close the Document Properties dialog box.

Notice the values in the Property Inspector—the dimensions, background color, and frame rate changed to reflect the settings you speci-fied in the Document Properties dialog box.

You can quickly use the Property Inspector at any point to change the movie’s background color or framerate. In addition, you can use the Size button to access the Document Properties dialog box, where youcan change the Stage dimensions and ruler units. However, avoid changing dimensions once you havestarted adding content to your Stage. Changing Stage dimensions at this point offsets the position ofyour artwork, which can be difficult to fix.

Save your changes and leave movie.fla open for the next exercise.8

7

6

5

73Chapter 4 : Animation Basics

FL08_04 (070-097).qxd 11/29/05 3:11 PM Page 73

Page 5: Macromedia Flash Professional 8 Hands-On Training (ISBN 0 ...files.lynda.com/files/edu-media/EDU_HOT_CHAPTERS/... · In the Property Inspector , type 24 in the Frame rate field

Before you start creating animations, you need tounderstand two terms—frames and keyframes. InFlash 8, the Timeline represents the passing oftime, with each slot in the Timeline representingan individual frame. Keyframes are a special typeof frame that represent a change in content. Forexample, if you have artwork in Frame 1, and youdon’t change it until Frame 20, the image inFrame 1 will persist until Frame 20. In order tochange the appearance of an animation, you must

add a new keyframe. For example, if you have artwork in Frame 1, and you want to change it inFrame 2, you must add a new keyframe in Frame2, indicating the change. A keyframe indicates achange in content between two frames.

If you’ve never worked with animation before,these concepts may seem foreign to you. Not toworry, you’ll have lots of opportunities to workwith frames and keyframes in this chapter.

Flash Professional 8 : H•O•T74

Understanding Keyframes and Frames

T I P : Changing the Default Document PropertiesWhen you create a new movie, the default Stagesize is 550 x 400 pixels with a white background anda frame rate of 12 fps. These settings may not beconvenient when you are working on projects thatrequire different settings. But there’s good news—you can redefine the default settings so they betterfit your needs. Simply change the document prop-erties to match the settings you need and click theMake Default button. Next time you create a newmovie, it will already have all the properties youspecified. Pretty cool!

Blank keyframe with actions

Blank keyframe Keyframe Blank keyframe with sound

FL08_04 (070-097).qxd 11/29/05 3:11 PM Page 74

Page 6: Macromedia Flash Professional 8 Hands-On Training (ISBN 0 ...files.lynda.com/files/edu-media/EDU_HOT_CHAPTERS/... · In the Property Inspector , type 24 in the Frame rate field

75Chapter 4 : Animation Basics

Before you start the hands-on exercises, you need to identify and create frames and keyframes in theTimeline. The following chart describes each in more detail, including the keyboard shortcuts whereavailable.

Working with Frames and Keyframes

Feature Description

Frame Just like film, Flash 8 divides lengths of time into frames. The frame rate deter-mines how much time each frame takes up. For example, if your movie’s framerate is 12 fps, one frame will take up 1/12 of 1 second. If an object is on theStage for 24 frames, it will appear visible for 2 seconds in the movie. You’ll learnmore about frame rate later in this chapter.

Although the Timeline in Flash 8 has slots for frames, you have to define themas frames or keyframes in order for the content to exist at that point in themovie. Different layers can have different numbers of frames. For example,Layer 1 could have 10 frames while Layer 2 has only one.

When you define a frame, all of the previous slots are also defined as frames. Ifyou have artwork on the Stage, it will continue to exist when you add frames tothe Timeline.

If you insert frames between keyframes, you will lengthen the time of your animation.

To define or insert frames, select any slot(s) and/or frame(s) in the Timeline andpress F5 or choose Insert > Timeline > Frame.

Keyframe A keyframe indicates a change in content or motion between frames. Akeyframe containing artwork is represented by a solid, black circle. By default,when you add a new keyframe in Flash 8, the content (except for actions andsounds) is copied from the previous keyframe. (If there is no previous keyframe,the layer will be blank up and until the new keyframe.) To make a change to theartwork in the new keyframe, you select the keyframe before you alter the art-work on the Stage. Simply adding a keyframe will not change the artwork.

To insert a new keyframe, select any slot or frame in the Timeline to select itand press F6 (Windows only) or choose Insert > Timeline > Keyframe.

Clear keyframe Clearing a keyframe removes the contents of the keyframe but leaves the frameitself. This process will not reduce the number of frames on a layer but will sim-ply remove the keyframe and change it to a regular frame. The content fromthe previous keyframe will then continue through the existing frames. If the pre-vious keyframe is a blank keyframe, there will be no content through the exist-ing frames (in this case, you may want to remove frames instead; see Removeframes below).

continues on next page

FL08_04 (070-097).qxd 12/5/05 4:30 PM Page 75

Page 7: Macromedia Flash Professional 8 Hands-On Training (ISBN 0 ...files.lynda.com/files/edu-media/EDU_HOT_CHAPTERS/... · In the Property Inspector , type 24 in the Frame rate field

76 Flash Professional 8 : H•O•T

Working with Frames and Keyframes continued

Feature Description

Remove frames If you need to delete frames, keyframes, or blank keyframes, select theframes in the Timeline and press Shift+F5 or choose Edit > Timeline >Remove Frames (Windows only). You can also remove frames by right-click-ing (Windows) or Ctrl+clicking (Mac) a frame and choosing Remove Framesfrom the pop-up menu.

Blank keyframe A blank or empty keyframe indicates there is no artwork on the Stage. Bydefault, when you create a new document, the Timeline contains one blankkeyframe, which you can identify by the empty circle icon. As soon as youcreate or place artwork on the Stage, the empty circle icon changes to asolid, black circle, indicating the keyframe contains artwork. Once you haveartwork on a keyframe, any new keyframe or frame you create will alsoinclude the artwork from the previous keyframe. A blank keyframe, however,will remove any content, including actions and sounds, from the Stage onthat layer at that point.

If you insert a blank keyframe into an empty slot after a keyframe or frame,the previous empty slots will be defined as frames.

Although a blank keyframe contains no artwork, it can contain sound andactions. You will learn more about sound in Chapter 14, “Sound,” and moreabout actions in Chapter 12, “ActionScript Basics and Behaviors.”

To insert a blank keyframe, select any slot(s) and/or frame(s) in the Timelineand press F7 (Windows only) or choose Insert > Timeline > Blank Keyframe.

FL08_04 (070-097).qxd 12/5/05 4:30 PM Page 76

Page 8: Macromedia Flash Professional 8 Hands-On Training (ISBN 0 ...files.lynda.com/files/edu-media/EDU_HOT_CHAPTERS/... · In the Property Inspector , type 24 in the Frame rate field

A common animation technique is to make a word appear as though it is being written before your eyes.You can achieve this effect easily using keyframes. When you insert a keyframe, Flash 8 copies the con-tent of the previous keyframe to the newly created keyframe, which you can then change to create ananimation. In this exercise, you’ll learn how to make the word xboard! animate on the Stage using frame-by-frame animation.

Open movieFinal.fla from the chap_04 folder.

The easiest way to understand animations is to look at a finished example, such as the one in movieFinal.fla.

Press Enter (Windows) or Return (Mac) to preview the animation on the Stage.

Notice the animation creates the word xboard! magically before your eyes! Although it may seem com-plicated, you’ll see how easy it is to create a frame-by-frame animation with keyframes in this exercise.

Close movieFinal.fla. If you com-pleted Exercise 1, movie.fla should stillbe open. If it’s not, open the movie.fla fileyou saved in Exercise 1 or go back andcomplete Exercise 1.

Notice movie.fla contains a single layer with a single blank keyframe. This is the minimum you need tostart drawing, and this is the way all new documents appear by default.

In the Timeline, double-click theLayer 1 name. When the bounding boxappears, rename the layer xboard! andpress Enter (Windows) or Return (Mac).

Naming layers keeps them recognizable and organized.

4

3

2

1

77Chapter 4 : Animation Basics

2E X E R C I S E

Frame-by-Frame Animation with Keyframes

Blank keyframeBlank layer

FL08_04 (070-097).qxd 11/29/05 3:11 PM Page 77

Page 9: Macromedia Flash Professional 8 Hands-On Training (ISBN 0 ...files.lynda.com/files/edu-media/EDU_HOT_CHAPTERS/... · In the Property Inspector , type 24 in the Frame rate field

Select the Brush tool from the toolbar. From the Color and Options sections of the toolbar, selectany size, shape, and color (other than white—you’ll see why in Step 11).

The Brush tool only paints fills, not strokes, so you want to change the color in the Fill Color well.

Over the next few steps, you’ll write the word xboard!, one letter at a time, in a series of keyframes.

With the Brush tool selected in the toolbar, andFrame 1 selected in the Timeline, draw the first part of theletter x on the left side of the Stage, as shown in the illus-tration here.

Notice Frame 1 now contains a small black dot, indicatingit contains artwork. Frame 1 is now referred to as akeyframe, rather than a blank keyframe, because it is nolonger empty.

To make a change in the Timeline, you must place akeyframe where you want the change to occur. Now thatyou have filled in the first keyframe of Layer 1, you aregoing to add another keyframe at Frame 2 so you can draw the second frame of your animation. Addinga new keyframe after the last one will copy all the content from the previous keyframe to the newkeyframe. You will draw another stroke in this new keyframe to create a change in your animation.

In the Timeline, click Frame 2 to select it and choose Insert > Timeline > Keyframe or press F6.

This adds a new keyframe at Frame 2. Notice the contents of Frame 1 are the same as the contents ofFrame 2. You’ll add artwork to Frame 2 in the next step.

Tip: In Windows, remember the F6 keyboard shortcut, because you will be using it often to insertkeyframes.

With the Brush tool still selected and Frame 2 selectedin the Timeline, draw the second part of the x in the newkeyframe.

8

7

6

5

Keyframe 1 containing artwork

78 Flash Professional 8 : H•O•T

Content

FL08_04 (070-097).qxd 11/29/05 3:11 PM Page 78

Page 10: Macromedia Flash Professional 8 Hands-On Training (ISBN 0 ...files.lynda.com/files/edu-media/EDU_HOT_CHAPTERS/... · In the Property Inspector , type 24 in the Frame rate field

Choose Insert > Timeline > Keyframe to add a new keyframe to the Timeline in Frame 3.

Notice Frame 3 has the same contents as Frame 2.

With the Brush tool still selected and Frame 3selected in the Timeline, draw a b on the Stage. Clickand drag (scrub) the playhead back and forth in theTimeline to quickly preview the animation. You’ll seethe x and b being drawn directly on the Stage.

Choose Preview in Context from the Frame Viewmenu to display a thumbnail preview of the contents ofeach keyframe.

Viewing the Timeline with black dots representingkeyframes with artwork might seem somewhat abstractto you. The Frame View menu has several options fordisplaying the contents of your individual frames in theTimeline.

You’ll find the Preview in Context view helpful whencreating frame-by-frame animations.

Note: Do you remember when you chose a color forthe brush in Step 6, and you were asked to choose anycolor other than white? Now you can see why. If youhad chosen white for the brush color, you would notsee the artwork in Preview in Context view because theTimeline frames are also white.

With Frame 3 selected in the Timeline, choose Insert > Timeline > Keyframe to insert anotherkeyframe into Frame 4.12

11

10

9

79Chapter 4 : Animation Basics

Preview in Context view

FL08_04 (070-097).qxd 11/29/05 3:12 PM Page 79

Page 11: Macromedia Flash Professional 8 Hands-On Training (ISBN 0 ...files.lynda.com/files/edu-media/EDU_HOT_CHAPTERS/... · In the Property Inspector , type 24 in the Frame rate field

With the Brush tool still selected, draw an o on the Stage. As you draw, you’ll see the contents ofFrame 4 appear in the Timeline preview.

As you continue to spell out the word xboard!, you don’t have to draw the whole letter in each keyframe.Instead, you can draw a part of the letter (just as you did with the x) in one keyframe, choose Insert >Timeline > Keyframe to insert the next keyframe, and draw the remaining parts of the letter in thatkeyframe to create a more realistic animation.

Using the techniques you learnedin this exercise, use the Brush tool andadd new keyframes to finish drawingthe word xboard!. When you are done,your Timeline should look like the oneshown in the illustration here.

Scrub the playhead across the Timeline to preview the animation on the Stage.

Press Enter (Windows) or Return (Mac) to play the animation once.

Unlike scrubbing the playhead, when you press Enter (Windows) or Return (Mac) to preview the anima-tion on the Stage, you see an accurate preview of the frame rate for the animation, which you set to 24fps in Exercise 1.

Choose Control > Loop Playback and press Enter (Windows) or Return (Mac) to repeat the anima-tion continuously. Looping repeats the animation until you choose to stop it.

Notice how fast the animation plays. Next, you’ll learn how to slow down the animation by adjusting theframe rate, which defines how many frames your animation plays per second. Due to varying processorspeeds, there is no guarantee your movie will always play back at the specified frame rate on every com-puter. Keep this in mind when you’re designing and testing animations. If possible, always test yourmovies on a variety of computers with varying processor speeds so you can get an accurate idea of therange of results your viewers will see.

Press Enter (Windows) or Return (Mac) to stop the animation.18

17

16

15

14

13

80 Flash Professional 8 : H•O•T

FL08_04 (070-097).qxd 11/29/05 3:12 PM Page 80

Page 12: Macromedia Flash Professional 8 Hands-On Training (ISBN 0 ...files.lynda.com/files/edu-media/EDU_HOT_CHAPTERS/... · In the Property Inspector , type 24 in the Frame rate field

Choose Normal from theFrame View menu to changethe Timeline back to Normalview so you see keyframes inthe Timeline instead of a pre-view of the artwork.

Make sure the Property Inspector is visible. If it’s not, choose Window > Properties.

In the Frame rate field, decreasethe frame rate to 12. As you learned inExercise 1, 12 fps is the default framerate when you create a new movie inFlash 8.

Press Enter (Windows) or Return (Mac).

Notice the animation plays slower. The movie is taking twice as long to play the same number of frames.The lower the frame rate, the slower the animation plays (and vice versa). Go ahead and experiment with other frame rates. When you’re finished experimenting, return the frame rate to its default setting of 12 frames per second so you’re ready for the next exercise.

Save and close movie.fla.23

22

21

20

19

81Chapter 4 : Animation Basics

Timeline in Normal view

FL08_04 (070-097).qxd 11/29/05 3:12 PM Page 81

Page 13: Macromedia Flash Professional 8 Hands-On Training (ISBN 0 ...files.lynda.com/files/edu-media/EDU_HOT_CHAPTERS/... · In the Property Inspector , type 24 in the Frame rate field

When you set a frame rate in Flash 8, you’re set-ting the maximum frame rate for your movie, orhow quickly the movie “tries” to play. The actualplayback frame rate depends on several factors,including the download speed and processorspeed of the computer used to view the movie. If the frame rate is set higher than the computercan display, the movie will play as fast as the com-puter’s processor will allow. If you set the framerate to 200 (which is really high), the average com-puter will not be able to display the movie at thisrate. Also, frames with more objects, colors, or

transparency than others take more time for thecomputer to render. Thus, the actual frame ratecan vary during playback due to the renderingrequirements from one frame to another.

Based on these factors, use a frame rate of atleast 12 fps and not more than 25 fps, so the average computer can display your movie as youintended. A frame rate of 15 to 20 fps, which issimilar to the 24 fps used in motion pictures,works well most of the time.

The frame rate determines the number of framesyour movie plays per second. This rate corre-sponds directly to the length of time your anima-tion takes to play.

Here’s how to use the frame rate to calculate theplayback time of your animation. Start with thetotal number of frames in the Timeline and divideit by the frame rate; the result is the number ofseconds it will take to view your movie.

For example, if your Timeline has 36 frames, andyour frame rate is set to 12 fps, your animation

Recommended Frame Rates

length will be 3 seconds. The following chart givesexamples of how the frame rate affects the dura-tion of the animation. Next, you will learn how tocreate more than one animation in the samemovie and have them play at different speeds.

Flash Professional 8 : H•O•T82

What Is the Frame Rate?

Frame Rate

Number of Frames ÷ Frame Rate = Duration

24 frames ÷ 12 fps = 2 seconds

36 frames ÷ 12 fps = 3 seconds

48 frames ÷ 24 fps = 2 seconds

Frame rateTotal number of frames

FL08_04 (070-097).qxd 11/29/05 3:12 PM Page 82

Page 14: Macromedia Flash Professional 8 Hands-On Training (ISBN 0 ...files.lynda.com/files/edu-media/EDU_HOT_CHAPTERS/... · In the Property Inspector , type 24 in the Frame rate field

As you learn to create animations, you’ll want to adjust the speed of your animations. In the previousexercise, you learned how to adjust the frame rate to increase and decrease the speed of an animation.But what do you do if you want only certain sections of your movie to play faster or slower than othersections? In this exercise, you will learn how to insert and remove frames in the Timeline so different sections of an animation play at different speeds, even though they all share the same frame rate.

Open frames.fla from the chap_04folder.

As you can see, the file contains one layerwith a simple frame-by-frame animationusing text. You’ll get a chance to work withtext in Chapter 13, “Working with Text.”

Press Enter (Windows) or Return (Mac) to preview the animation on the Stage.

As you can see, the animation plays so fast you almost lose the effect of the text appearing one letter ata time. Adjusting the frame rate to slow down this animation will affect the entire movie, which could beproblematic because you may want other sections of your movie to play at a different speed. For exam-ple, in this project you may want the word snow to appear slowly and the word board to appear quickly.You can solve this problem easily by inserting duplicate frames at strategic points to lengthen parts ofthe animation.

In the Timeline, click Frame 1 to selectit. Choose Insert > Timeline > Frame (F5),which duplicates the contents of Frame 1and extends the Timeline by one frame.

When you add a new frame, Flash 8 createsa duplicate of the preceding frame. Youaren’t going to change this content; if youwanted to change the duplicate content, akeyframe would have been a better choice.

With Frame 1 still selected in the Timeline, press F5 to insert another frame. Each time you chooseInsert > Timeline > Frame or press F5, you will insert one frame to extend the Timeline.4

3

2

1

83Chapter 4 : Animation Basics

3E X E R C I S E

Inserting and Deleting Frames

FL08_04 (070-097).qxd 11/29/05 3:12 PM Page 83

Page 15: Macromedia Flash Professional 8 Hands-On Training (ISBN 0 ...files.lynda.com/files/edu-media/EDU_HOT_CHAPTERS/... · In the Property Inspector , type 24 in the Frame rate field

With Frame 1 still selected in theTimeline, press F5 eight more times (givingyou a total of 11 additional frames betweenthe first two keyframes).

By adding more frames, you are extending thedistance between the first two keyframes inthe Timeline. The additional frames slow downthe speed of the animation because the con-tent of Keyframe 1 will display for a longerperiod of time.

Press Enter (Windows) or Return (Mac) to preview the animation on the Stage.

Notice there is a significant delay between the letters s and n—about one second—because 12 framesdivided by 12 fps = 1 second. Even though you changed the delay between the letters s and n, you didn’t affect the speed of the rest of the animation. As you can see, this is a great trick to use when youwant to play different sections of an animation at different speeds.

In the Timeline, click Frame 13 to select it.

Frame 13 is the new location of the secondkeyframe. It was originally in Frame 2 beforeyou added more frames in Steps 3, 4, and 5.

7

6

5

84 Flash Professional 8 : H•O•T

T I P : What Do Those Dots Mean?As you start adding content toyour project, you’ll notice differ-ent icons in the Timeline. Theblack dots indicate keyframeswith content. The light-grayframes without icons indicateframes (no change in content).For example, in the illustration here, Frames 2, 3, and 4 have the same content asKeyframe 1. The white rectangle indicates the last frame in a frame range, which meansthe next frame will be either a blank keyframe (empty) or a keyframe (with content). In this example, the empty circle icon indicates a blank keyframe.

Keyframe Final frame before change Blank keyframe

FL08_04 (070-097).qxd 11/29/05 3:12 PM Page 84

Page 16: Macromedia Flash Professional 8 Hands-On Training (ISBN 0 ...files.lynda.com/files/edu-media/EDU_HOT_CHAPTERS/... · In the Property Inspector , type 24 in the Frame rate field

Press F5 11 times to insert 11 frames inthe Timeline.

Each added frame contains the same contentas Frame 13, creating another pause betweenthe letters n and o.

Using the techniques you learned in Steps 7 and 8, add frames between the letters o and w.

Press Enter (Windows) or Return (Mac)to preview the animation on the Stage.

Notice how much slower the word snow ani-mates compared to the word board. As youcan see from this exercise, you can controlthe timing of an animation without having toadjust the frame rate of the entire movie.Inserting frames slows down specific sectionsin the animation. The inverse is also true—you can speed up an animation by deletingframes. You’ll learn how in the next few steps.

In the Timeline, click Frame 2 to select it.Right-click (Windows) or Ctrl+click (Mac) and choose Remove Frames from the con-textual menu or use the Windows shortcutkey Shift+F5 to remove the currentlyselected frame.

As you can see, you shortened the Timelineby one frame and decreased the amount of time between the letters s and n in youranimation.

Click and drag Frames 7 through 11 to multiple-select the frames.12

11

10

9

8

85Chapter 4 : Animation Basics

The Timeline is now shorter by one frame.

FL08_04 (070-097).qxd 11/29/05 3:12 PM Page 85

Page 17: Macromedia Flash Professional 8 Hands-On Training (ISBN 0 ...files.lynda.com/files/edu-media/EDU_HOT_CHAPTERS/... · In the Property Inspector , type 24 in the Frame rate field

With Frames 7 through 11 selected,choose Edit > Timeline > Remove Frames (oruse the Windows shortcut key Shift+F5) toremove the selected frames and shorten yourTimeline by five frames.

Using the techniques you learned in Steps11, 12, and 13, reduce the number of framesso there are only five frames between the s, n,o, and w keyframes.

Press Enter (Windows) or Return (Mac) to preview your animation on the Stage.

As you can see, the word snow now plays faster than it did in Step 10, but still slower than the letters in the word board. The animation plays at two speeds because there are more frames between thekeyframes in the word snow but fewer frames between the keyframes for the word board. Adding framesis a great technique for speeding up or slowing down the timing of animations without changing theframe rate of the entire movie.

Close frames.fla. You don’t need to save your changes.16

15

14

13

86 Flash Professional 8 : H•O•T

FL08_04 (070-097).qxd 11/29/05 3:12 PM Page 86

Page 18: Macromedia Flash Professional 8 Hands-On Training (ISBN 0 ...files.lynda.com/files/edu-media/EDU_HOT_CHAPTERS/... · In the Property Inspector , type 24 in the Frame rate field

Creating a looping animation (one that repeats indefinitely) can be a lot of work if you have to draw eachframe over and over. In Flash Professional 8, you can copy, paste, and reverse a sequence of frames tocreate a looping animation. You will learn how in this exercise.

Open loopingFinal.fla from thechap_04 folder. Choose Control >Loop Playback to set the playbackoption to Loop, or repeat indefinitely.Press Enter (Windows) or Return(Mac) to preview the animation on the Stage.

This is the completed version of theanimation you’ll create in this exercise.As you can see, the snowboardercruises down and up the mountainslope over and over. You will createthis same animation technique withouthaving to draw all the frames overagain.

Choose Control > Loop Playback to stop the animation from looping. Press Enter (Windows) orReturn (Mac) to stop previewing the animation on the Stage. Close loopingFinal.fla

Open looping.fla from thechap_04 folder.

The file contains a single layer namedsnowboarding, which contains asequence of 10 keyframes. In eachkeyframe, the boarder is a little fur-ther down the slope, creating the illu-sion that the boarder is moving downthe slope when the sequence isplayed back.

3

2

1

87Chapter 4 : Animation Basics

4E X E R C I S E

Copying and Reversing Frames

FL08_04 (070-097).qxd 11/29/05 3:12 PM Page 87

Page 19: Macromedia Flash Professional 8 Hands-On Training (ISBN 0 ...files.lynda.com/files/edu-media/EDU_HOT_CHAPTERS/... · In the Property Inspector , type 24 in the Frame rate field

In the Timeline, click the snowboard-ing layer to select all the frames.

Selecting a layer in the Timeline is an easyway to multiple-select the frames on alayer. Next, you’ll make a copy of theselected frames.

Position your pointer over theselected frames. Click and drag theframes to the right, inside the Timeline.Don’t release the mouse just yet!

Notice as you click and drag the frames alight-gray outline indicates the selectedframes and where they’ll be moved whenyou release the mouse button.

Without releasing the mouse, hold down the Alt (Windows) or Option(Mac) key.

Notice the small plus sign appears to theright of the pointer indicating you willduplicate (or copy), not move (or cut), theframes when you release the mouse.

Release the mouse to create a copyof the selected frames in Frames 11through 20.

Press Enter (Windows) or Return (Mac) to preview the movie on the Stage.

Notice the animation does not look correct. The boarder reaches the bottom of the slope and jumpsback up to the top, which is not the same as the single fluid motion you saw in the finished animation. Intraditional animation, you’d have to redraw all the frames in reverse order to achieve this effect.Fortunately in Flash 8, you can save yourself that manual process and simply duplicate and reverse theexisting frames in the animation. You’ll learn how in the next steps.

8

7

6

5

4

88 Flash Professional 8 : H•O•T

Selected frames

FL08_04 (070-097).qxd 11/29/05 3:12 PM Page 88

Page 20: Macromedia Flash Professional 8 Hands-On Training (ISBN 0 ...files.lynda.com/files/edu-media/EDU_HOT_CHAPTERS/... · In the Property Inspector , type 24 in the Frame rate field

Click Frame 11 and then Shift+click Frame 20 to select Frames 11 through 20. Choose Modify > Timeline > Reverse Frames.

You won’t see a change in the Timeline, but you will notice the change on the Stage when you test the movie.

Press Enter (Windows) or Return (Mac) to preview your animation on the Stage. As you can see,the snowboarder races down the hill and goes back up the hill, as if you were rewinding the film to viewan instant replay! Nice! If you choose Control > Loop Playback, you can watch the animation previewloop endlessly.

Close looping.fla. You don’t need to save your changes.11

10

9

89Chapter 4 : Animation Basics

FL08_04 (070-097).qxd 11/29/05 3:12 PM Page 89

Page 21: Macromedia Flash Professional 8 Hands-On Training (ISBN 0 ...files.lynda.com/files/edu-media/EDU_HOT_CHAPTERS/... · In the Property Inspector , type 24 in the Frame rate field

Now that you have created a couple of frame-by-frame animations, it’s a good time to add a few newtricks to your bag. First, you’ll learn to use the Onion Skinning feature, which lets you to see a ghostimage of the previous frame so you can see where you want to place the artwork in relation to the pre-ceding frames. You will also learn to use the Free Transform tool, which allows you to scale, rotate, skew,and distort your artwork.

Open onionFinal.fla file from the chap_04folder. Choose Control > Loop Playback to setthe playback option to loop, or repeat indefinitely.Press Enter (Windows) or Return (Mac) to previewthe animation on the Stage.

This is the completed version of the animationyou’ll create in this exercise. In this animation,you’ll see the snowboarder catching some air! Youwill create this same animation technique withouthaving to draw all the frames over again.

Choose Control > Loop Playback to stop the looping. Press Enter (Windows) or Return (Mac) tostop previewing the animation on the Stage. When you’re finished viewing the animation, closeonionFinal.fla.

Open onion.fla from the chap_04 folder.

This file contains one keyframe with the snow-boarder beginning his jump on the top layer andone keyframe with the snow on the bottom layer.The snow layer has been locked so that you don’taccidentally select something on it. You will bemodifying the artwork and creating the frame-by-frame animation on the snowboarder layer in thenext few steps.

3

2

1

90 Flash Professional 8 : H•O•T

5E X E R C I S E

Using Onion Skinning

FL08_04 (070-097).qxd 11/29/05 3:12 PM Page 90

Page 22: Macromedia Flash Professional 8 Hands-On Training (ISBN 0 ...files.lynda.com/files/edu-media/EDU_HOT_CHAPTERS/... · In the Property Inspector , type 24 in the Frame rate field

Click Frame 2 of the snowboarder layer to select it and choose Insert > Timeline > Keyframe toadd a keyframe.

Frame 2 now contains a small black dot, indicating it contains content. As you know from Exercise 2, whenyou create a new keyframe, it copies the content from the previous keyframe—in this case, Frame 1.

Tip: If you try to add a keyframe without first selecting a frame, nothing happens. Why? When you havemore than one layer in your document, you have to select the frame so Flash 8 knows where to insert thekeyframe.

With the playhead on Frame 2, click the snow-boarder artwork on the Stage to select it. You’llknow it’s selected when you see the dotted mesh.Click and drag the snowboarder up and to the right,as though he is advancing in his jump.

Click the Onion Skin button.

Notice the faint ghost image showing the contentof Frame 1 on the Stage. Onion skinning lets yousee the artwork in the previous keyframes andchange the artwork relative to the ghost images.

6

5

4

91Chapter 4 : Animation Basics

Dotted mesh

Frame 2 content

Onion Skin button

Frame 1 content

FL08_04 (070-097).qxd 11/29/05 3:12 PM Page 91

Page 23: Macromedia Flash Professional 8 Hands-On Training (ISBN 0 ...files.lynda.com/files/edu-media/EDU_HOT_CHAPTERS/... · In the Property Inspector , type 24 in the Frame rate field

Select the Free Transform tool from the toolbar.

The Free Transform tool lets you modify selected artworkby changing the size, rotation, skew, and distortion. Tolearn more about the Free Transform tool, check out thechart at the end of this exercise.

Make sure the playhead is on Frame 2, and click the snowboarder on the Stage to select it.

Notice a bounding box appears around the artwork, indicating you can transform the artwork. If youposition the pointer near or over the handles (the squares in the corners and on the edges of the bound-ing box), the pointer changes, indicating the transform options.

Position your pointer just outside the upper-right cor-ner of the bounding box until it changes to the rotate icon(a round arrow). Click and drag to the right to rotate thesnowboarder slightly to make the jump look more realistic.

Click Frame 3 to select it and choose Insert > Timeline > Keyframe to insert another keyframe.10

9

8

7

92 Flash Professional 8 : H•O•T

N O T E : Onion Skin MarkersAfter you click the Onion Skin button, a gray barwith a draggable bracket on each end appears atthe top of the Timeline. These are called onionskin markers. The start onion skin marker (the oneon the left) is on Frame 1 (the first frame of youranimation), and the end onion skin marker (theone on the right) is on Frame 5 (the last frame ofyour animation). If you click and drag your playhead to the right or left, the start onionskin marker will move along with it. You can also drag either of the onion skin markersto the left or right to include more frames if they are spanning fewer keyframes thanyou have in the Timeline.

Onion Skin markers

FL08_04 (070-097).qxd 11/29/05 3:12 PM Page 92

Page 24: Macromedia Flash Professional 8 Hands-On Training (ISBN 0 ...files.lynda.com/files/edu-media/EDU_HOT_CHAPTERS/... · In the Property Inspector , type 24 in the Frame rate field

Click the snowboarder artwork with the FreeTransform tool to select it. Click and drag to move thesnowboarder to the right. Using the technique you learnedin Step 9, click and drag to rotate the snowboarder.

Repeat Steps 10 and 11 twice more, addingkeyframes to Frames 4 and 5, positioning, and rotatingthe artwork in each keyframe. When you’re finished, theartwork on the Stage should match the artwork shown in the illustration here.

Choose Control > Loop Playback. Press Enter(Windows) or Return (Mac) to preview the movie on theStage. When you’re finished, choose Control > LoopPlayback to stop the movie from repeating and pressEnter (Windows) or Return (Mac) to stop the movie.

As you can see, the snowboarder is catching some air—just like in the final movie you looked at in Step 1!

If you do not want the onion skin markers to move whenyou move the playhead or click a frame in the Timeline,you can choose Anchor Onion from the Modify OnionMarkers button pop-up menu to lock the onion skinning span where it is until you unlock it again or manually drag the start or end onion skin markers.

Experiment with the Free Transform tool to create more effects. Try resizing, rotating, and skewingusing the editing nodes.

You’ll get a chance to work with the Free Transform tool again in Chapter 6, “Symbols and Instances.”

When you are finished experimenting, close onion.fla. You don’t need to save your changes.15

14

13

12

11

93Chapter 4 : Animation Basics

Modify Onion Skin markers

FL08_04 (070-097).qxd 11/29/05 3:12 PM Page 93

Page 25: Macromedia Flash Professional 8 Hands-On Training (ISBN 0 ...files.lynda.com/files/edu-media/EDU_HOT_CHAPTERS/... · In the Property Inspector , type 24 in the Frame rate field

94 Flash Professional 8 : H•O•T

V I D E O : onion.movTo learn more about onion skinning, check out onion.mov in the videos folder on theHOT CD-ROM.

N O T E : The Free Transform ToolThe Free Transform tool lets you modify objects in several ways. As you position thepointer over the bounding box of a selected object, it will change to indicate whattype of transformation is available. As you click and drag, you will see a preview of thetransformation you are about to make. The following chart lists how you can use theFree Transform tool to transform objects.

Free Transform Tool Features

Clicking and dragging up or down on a corner transform handle rotates theobject. The pointer icon changes to a round arrow, indicating that you can rotatethe object.

Clicking and dragging diagonally on one of the corner transform handles modi-fies the scale of the object. The pointer changes to a diagonal double-pointedarrow when you can perform this transformation.

Clicking and dragging one of the middle side transform handles modifies thewidth or height of the object. The pointer changes to a horizontal (or verticaldepending on which side you are on) double-pointed arrow when you can per-form this transformation.

Clicking and dragging between any two transform handles skews the object. The pointer changes, indicating that you can skew the object.

Clicking and dragging one of the middle side transform handles to the otherside of the object flips the object. The pointer changes to a horizontal or verticaldouble-pointed arrow depending on which side you are on.

Clicking and dragging the center registration point modifies the center point ofthe object. After you alter the center point, all transformations will rotate ormove in relation to the new center point location.

FL08_04 (070-097).qxd 11/29/05 3:12 PM Page 94

Page 26: Macromedia Flash Professional 8 Hands-On Training (ISBN 0 ...files.lynda.com/files/edu-media/EDU_HOT_CHAPTERS/... · In the Property Inspector , type 24 in the Frame rate field

So far, you’ve been testing your movies by previewing them on the Stage. This is a great way to test theframe rate, but there are other ways to test your work. In this exercise, you will learn how to preview themovie file as a SWF file—the format you would use to publish the movie to the Web—with the TestMovie feature. You’ll learn a really easy way to produce the HTML file required to view the SWF file in aWeb browser. You’ll also learn how to preview the movie in a browser with the Preview in Browser fea-ture. This exercises covers the basics—you’ll find more in-depth information about publishing Flash 8content in Chapter 17, “Publishing and Exporting.”

Open frames_Test.fla from the chap_04 folder.

It is important to know where your project file(FLA) has been saved before you use the TestMovie and Preview in Browser featuresbecause Flash 8 generates new files and auto-matically saves them in the same location asyour project file (FLA). If you saved your file ina different location, just make sure you knowwhere it is. In this case, you’re working withframes_Test.fla, which is included in thechap_04 folder.

Choose Control > Test Movie or pressCtrl+Enter (Windows) or Cmd+Return (Mac)to preview the movie file in a new window asa SWF file.

When you test the movie, Flash 8 automati-cally previews the movie as a SWF file, whichis exactly what you’d see if you exported thefile as a SWF.

Tip: You can click and drag the resize handleof the preview window to change its size. Although the size of the window changes, the snowboard let-ters stay the same size. You’ll learn how to make content scalable using the publish settings in Chapter17, “Publishing and Exporting.”

2

1

95Chapter 4 : Animation Basics

6E X E R C I S E

Testing Movies

Resize handle

FL08_04 (070-097).qxd 11/29/05 3:12 PM Page 95

Page 27: Macromedia Flash Professional 8 Hands-On Training (ISBN 0 ...files.lynda.com/files/edu-media/EDU_HOT_CHAPTERS/... · In the Property Inspector , type 24 in the Frame rate field

With the preview windowstill open, choose Window >Toolbars > Controller to openthe Controller toolbar.

This handy little gadget isespecially useful with longermovies—it lets you easily stop, restart, or step back one frame at a time in theTimeline.

Click the Stop button to stop your animation.

Click the Play button to play the animation. If you’d like, experiment with the other buttons on the Controller toolbar.

Although you didn’t see it happen, when you tested the movie in Step 2, Flash 8 automatically created theSWF for the movie and saved it in the same location as your project (FLA) file. You’ll locate this file next.

Open the chap_04 folder.

Notice the frames_Test.swf file inside thisfolder. This file was automatically gener-ated by Flash 8. Also notice the SWF filehas a different icon than the FLA files,which can be helpful visual feedback,especially if your file extensions areturned off. The SWF file is the file you’duse on a Web page in the same manneryou would use a GIF or JPG.

6

5

4

3

96 Flash Professional 8 : H•O•T

T I P : Loop-de-loopAt this point, you’re probably wondering why your animation is looping (playing over andover). This is the default behavior of all movies in Flash 8, although you don’t see it whenyou simply press Enter (Windows) or Return (Mac) to preview your movie (unless you’veturned on the Loop Playback option). If you upload the published file to the Web, it wouldloop. You will learn to control the looping in your final movie (SWF) file in Chapter 12,“ActionScript Basics and Behaviors,” when you learn how to add actions to frames. If allthis looping is making you dizzy, you can choose Control > Loop Playback to toggle thisfeature off.

Stop

Rewind Play

Step Back Step Forward

Go to End

FL08_04 (070-097).qxd 11/29/05 3:12 PM Page 96

Page 28: Macromedia Flash Professional 8 Hands-On Training (ISBN 0 ...files.lynda.com/files/edu-media/EDU_HOT_CHAPTERS/... · In the Property Inspector , type 24 in the Frame rate field

Return to Flash 8 and close the preview window.

Choose File > Publish Preview > Default – (HTML) orpress F12 to launch your default browser with a preview ofyour movie file (SWF).

Previewing the SWF file in a browser is a quick and easyway to see what the movie looks like and how it plays backin a browser. Although this technique is great for preview-ing your movies, you’ll learn better ways to publish thefinal SWF file in Chapter 17, “Publishing and Exporting.”

Hide Flash 8 and navigate to the chap_04 folder.

Notice there is a frames_Test.html file inside the chap_04 folder. When you published a preview of thefile in Step 8, Flash 8 generated the HTML file automatically, which is what lets you view the SWF file in abrowser.

At this point, all the files necessary to publish to the Web have been generated for you automatically.More thorough instructions and details about this process will be provided in Chapter 17, “Publishingand Exporting.” The purpose of this exercise was to demonstrate a quick and easy way to preview yourprojects.

Return to Flash 8. Closeframes_Test.fla. You don’t need to saveyour changes.

Congratulations—you just completed along, but essential, part of your animationtraining! The next three chapters focus onmore complex and specific animationtopics, such as shape tweening, symbolsand instances, and motion tweening.Now would be a great time for a break.You’ve worked through a lot of material,and you deserve one!

10

9

8

7

97Chapter 4 : Animation Basics

N O T E : Defining a Default BrowserIf you have several browsers installed on your computer, you can specify which oneFlash uses as the default browser. There’s a great explanation of how to define defaultbrowsers in Windows and on a Mac on Macromedia’s Web site: http://www.macromedia.com/support/flash/ts/documents/browser_pref.htm.

FL08_04 (070-097).qxd 11/29/05 3:12 PM Page 97