4.11. Controlling Morphing
Problem
You want to control how Flash shape tweens a graphic, because Flash by itself does not morph it satisfactorily.
Solution
Use shape hints and/or add intermediary keyframes and manually redraw the shapes.
Discussion
When you employ a shape tween, Flash compares the starting and stopping state and does its best to correlate significant points in each state to each other to guide the tween. Unless you are working with primitive geometric shapes, such as squares and circles, Flash often struggles, and intervening frames look less like a natural transition between the two states, and more like a kaleidoscopic and quasi-random explosion of lines and shapes.
Figure 4-5 shows a shape tween of the letter A morphing into the letter B. Flash made some dubious decisions. Notice how the lower-left corner of the A morphs into the upper-left corner of the letter B rather than remaining where it is. Likewise, the upper-left corner of the A morphs around to the front of the letter B rather than staying where it is. This is a result of Flash guessing which points in the beginning of the animation should correspond to which points at the end of the animation.

Figure 4-5. Shape tweens look strange when Flash has to guess which points in the original correspond to certain points in the final graphic
Rather than forcing Flash to guess and living with the results, we can give Flash ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access