Chapter 26. Interacting with Movie Clips

This chapter continues your exploration of the MovieClip class in ActionScript 3.0. You explore the ins and outs of collision detection for MovieClip objects and learn how to control the visibility of the mouse pointer or to attach a custom cursor to the mouse pointer. You look at other ActionScript elements such as ColorTransform and Sound objects that work with MovieClip objects to create visual and audio effects, respectively.

You also learn how to print Flash content with the PrintJob class. The Flash Player creates high-quality output for hard copy artwork.

Movie Clip Collision Detection

Have you ever wanted to detect the intersection of two elements in a Flash movie? If two Movie Clip instances overlap on the Stage, how would you know? How would you tell ActionScript to look for an overlap? In ActionScript, there are two primary types of intersections (or collisions):

  • User-initiated collisions: This type of intersection occurs when you click and drag an object (a MovieClip object) and overlap another MovieClip object as you drag or release. You can also consider the mouse pointer an "object" that can intersect with another object. For example, if you move the mouse pointer over a MovieClip object, you can detect ...

Get Adobe® Flash® CS4 Professional 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.