Appendix B: Tweening in Code

The easiest way to tween a graphic or a movie clip is by right-clicking on a frame layer in the timeline and choosing ‘Create Motion Tween’. Unfortunately the results are not always fantastic. In this appendix we look at how you can use ActionScript to provide dynamic tweening that gives a much smoother and more flexible result. In the first part we will simply look at how ramping (easing) in and out of a move gives a more natural feel. Later we will look at how several keyframes can be linked together to create a smooth and curved motion, the same kind of motion you would get in a CG animation package.

A Bit of Background

Traditional cell animation was, until relatively recently, shot on a camera that was mounted ...

Get Flash MX 2004 Games 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.