1. Home
  2. Computing & Technology
  3. Animation

ActionScripting Basics: Collision Test Using hitTest

By , About.com Guide

5 of 10

So how are we going to tell the projectile that we’re ready for it to move? By right-clicking on the projectile and opening the Actions pane for a little ActionScripting, of course. This should be pretty familiar to you by now:

on (release) {
gotoAndPlay (2) ;
}

If that looks like Greek to you and you’re not sure how you should be applying it, you may want to head back to the more basic lessons for a bit—but for the sake of exposition (because I do so love to hear myself talk), let’s explain what we just did. We used an on command to tell Flash that on the release of a mouse click upon the projectile, the projectile’s timeline would go to frame 2 and play from there, thus circumventing the stop on frame 1 and initiating the animation that leads to the collision action.

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.