Chapter 27. Interacting with Movie Clips

IN THIS CHAPTER

  • Defining collisions

  • Using the hitTest() method

  • Using the ColorTransform class

  • Accessing the Sound class

  • Controlling the volume and balance of a sound

  • Printing Flash content with the PrintJob class

This chapter continues your exploration of the MovieClip class in ActionScript. 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.

Tip

Flash Player 8 introduced the ColorTransform class, which enables you to more easily apply color effects to your MovieClip objects. You can continue to use this class in ActionScript 2 targeted for Flash Player 9.

You will also learn how to print Flash content with the PrintJob class, introduced with Flash Player 7. 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 ...

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