• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 17. Unlocking the Power of Movie... > Detecting Movie Clip Collisions

Detecting Movie Clip Collisions

You can use the hitTest() method of the MovieClip class to determine whether any part of a movie clip overlaps either another movie clip or a particular point. The hitTest() method returns true if they coincide, otherwise false. Either or both of the clips, or any child clip, can have its _visible property set to false without affecting the hit test.

In the case of two movie clips, hitTest() checks whether their bounding boxes overlap. The bounding box is the smallest rectangle that contains all the graphics in the clip.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint