1. Home
  2. Computing & Technology
  3. Animation

ActionScripting Basics: Collision Test Using hitTest

By , About.com Guide

1 of 10

Determining collision action between two objects is one of the most important parts of ActionScripting that you can learn; it’s essential for almost any game that you might put together, and is even useful in content delivery and web designs. We’re going to demonstrate a simple collision action in which one animated object, the projectile, collides with another animated object, the target, and triggers some reaction in the target.

To start off with, create a basic projectile. Square are best until you get used to this; the hitTest determines what area counts as collision by an object’s bounding box, and irregular objects will still have a square bounding box—so they may seem to “collide” before the projectile actually enters the visible area of the object.

So: projectile. A small square, which you can then turn into a movie clip symbol. Give it an instance name—something simple and easily identifiable, like “projectile”.

Explore Animation
About.com Special Features

Holiday Central

What to eat, where to go, fun things to do and how to save money on the perfect gifts. More >

Family Tech Center

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

  1. Home
  2. Computing & Technology
  3. Animation
  4. Flash Animation Tutorials
  5. ActionScripting Basics: Collision Test Using hitTest

©2009 About.com, a part of The New York Times Company.

All rights reserved.