11.7. Transforming Movie Clips (Rotation, Scaling, and Skewing)

Problem

You want to rotate, scale, or skew a movie clip instance.

Solution

Use the drawing tools to modify the instance on the stage at authoring time.

For some properties, such as rotation and scaling, you can modify the values at runtime using ActionScript with the _rotation and _xscale and _yscale properties. Skewing is possible using a Matrix object.

Discussion

Not only can you modify movie clip instance locations and colors, you can also transform them in other ways, such as by rotating, scaling, or skewing them. This feature is extremely useful, because it allows you to perform these transformations on all the contents grouped within the movie clip. And even more beneficial is how you can then animate these transformations as well.

You can transform a movie clip instance at authoring time just as you can modify any symbol instance, as discussed in various recipes in Chapter 3. Use the authoring tools to perform rotation, scaling, and skewing tasks.

You can then animate these transformations over time by using a motion tween, just as you would use a motion tween to animate color or position changes over time. In addition to transforming a movie clip at authoring time, you can also perform these modifications at runtime using ActionScript. One of the advantages of using ActionScript to perform these changes is that you can add a greater degree of user interactivity. For example, you can create sliders and buttons that allow ...

Get Flash 8 Cookbook 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.