Chapter 39. Scripting Animation

FEATURED CLASSES

  • fl.motion.*

Animation is one of the serious strong points of the Flash platform. Flash evolved out of an animation tool, and it continues to be used to animate everything from web comics to popular television shows and advertisements. There has always been a big gap between using the Flash IDE to animate by hand and creating animations in ActionScript 3.0. Motion XML, introduced in Flash Professional CS3, helps to bridge this gap. In addition, the Flex framework sports its own animation framework, and there are a number of freely available third-party animation frameworks for ActionScript 3.0.

Understanding Flash Player and Animation

Intuitively, you know that animation is movement. Specifically, animation is movement achieved by sequencing individual still pictures. Your eyes and your brain conspire to interpret these separate pictures, or frames, as one fluid motion, through persistence of vision.

Frame Rate

Flash Player, like all things running on a computer, displays static frames in sequence. It attempts to display these frames as fast as the frame rate of the movie, which is measured in frames per second. Motion at 30 frames per second (fps) appears fluid, but presenting even more frames per second can help. In both Flex and Flash you have control over the frame rate of the SWF you publish, and I recommend using at least 30 fps unless you have a compelling reason not to.

Note

If video is playing in your SWF, the video still plays at ...

Get ActionScript 3.0 Bible 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.