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

Chapter 7. Controlling the Movie Clip > Detecting Movie-Clip Collisions

Detecting Movie-Clip Collisions

Now that you can make a movie clip that can be dragged around the Stage, you’ll want to know where the user drops it. If the movie clips are puzzle pieces, for example, you need to know whether or not those pieces are dragged and dropped on the correct spots.

It’s also valuable to check whether a movie clip intersects another movie clip. The game of Pong, for example, simply detects collisions between the ball, the paddles, and the wall, all of which are movie clips. Detecting movie-clip collisions can be useful on sophisticated e-commerce sites as well. Suppose that you develop an online shopping site that lets your customers drag merchandise into a shopping cart. You can detect when the object intersects with the shopping cart and provide interaction such as highlighting the shopping cart or displaying the product price before the user drops the object.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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