Smoothing the Animation by Adding Keyframes


The three-frame bouncing ball you created in the preceding task is crude; it's herky-jerky and much too fast. To smooth out the movement, you need to create more snapshots that define the ball's position in the air as it moves up and down. This means adding more keyframes and repositioning the ball slightly in each one.

In the preceding task, the ball moves from the top of the stage to the bottom in one step. In the following task, you expand that first bounce movement to three steps.

To add keyframes within an existing animation

1.

In the Timeline of the three-frame bouncing ball animation, select keyframe 1.

2.

Choose Insert > Timeline > Frame; then choose Insert > Timeline > Frame again.

Flash creates new in-between frames at frames 2 and 3, and relocates the keyframes that show the ball at the bottom and middle of the Stage to frames 4 and 5 (Figure 8.30).

Figure 8.30. With keyframe 1 selected, invoking the Insert > Timeline > Frame command twice inserts two new in-between frames after the first keyframe and pushes the original keyframe 2 (the ball at the bottom of the Stage) to frame 4.


3.

In the Timeline, select frames 2 and 3.

4.

Choose Modify > Timeline > Convert to Keyframes.

Flash converts the in-between frames to keyframes that duplicate the content of keyframe 1 (Figure 8.31).

Figure 8.31. Modify > Timeline > Convert to Keyframes changes the selected in-between frames to keyframes containing the content of the preceding keyframe.


5.

In the Timeline, select keyframe 2, and then reposition the ball on the Stage.

You can use the grid line to help you visualize where to place the ball; position it about a third of the distance between the top and bottom of the Stage.

6.

In the Timeline, select keyframe 3, and then reposition the ball on the Stage (Figure 8.32).

Figure 8.32. Reposition the ball in keyframes 2 and 3 to make the first bounce smoother.


Position the ball about two-thirds of the distance between the top and bottom of the Stage.

7.

Preview the animation using any of the methods described in the preceding section.

The initial bounce movement is smoother. Repeat these steps to add even more frames with incremental movement to the first half of the bounce. You can also add frames to make the second half of the bounce smoother.




Macromedia Flash 8 for Windows & Macintosh Visual QuickStart Guide
Macromedia Flash 8 for Windows & Macintosh
ISBN: 0321349636
EAN: 2147483647
Year: 2005
Pages: 204

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net