Apply Spring to a Motion

An A-flat played on a guitar sounds different from an A-flat on a trumpet. The note may be the same, but the differences in overtone and timbre make music beautiful and endlessly entertaining. Motion in the real world is like a symphony orchestra. A pencil, a feather, and a cooked noodle may move the same distance and arrive at the same resting point, but the subtleties of their motion are entirely different. Your audience subconsciously recognizes these differences. When you want to fine-tune motion's subtleties in Flash, turn to the Spring properties: Strength and Damping, which you find in the Properties panel when you select an IK Bone.

Here's a simple experiment that shows how Spring works. If you want to skip the first few steps for creating a rectangle shape with bones, use the file 09-5_Spring_Settings.fla from the Missing CD (www.missingmanuals.com/cds).

  1. Choose File→New→ActionScript 3.0.

    A new Flash document opens.

  2. Select the Rectangle tool (R) and then make sure object drawing mode (J) is toggled off.

    A simple shape works great for this demonstration.

  3. In the Properties panel, set Stroke to None and Fill to a color of your choice.

    Again, simplicity works just fine.

  4. Draw a skinny, horizontal rectangle across the top of the stage, as shown in Figure 9-15.

    In this animation, one side of the rectangle drops to the floor. The shape of the rectangle and the fluidity of the motion changes depending on the Spring properties.

    Figure 9-15. You apply Spring properties ...

Get Flash CS5: The Missing Manual now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.