What I am trying to do is check for collision of a movie clip instance named enemy with an instance of a movie clip called laser (which is inside a movie clip called ship).
When enemy collides with ship I want the main timeline to go to frame 2.
When enemy collides with laser I want the main timeline to go to frame 3.
The problem is that when ship.laser collides with enemy, it also counts as if ship was colliding with enemy.
Is there a way to check for the collision of ship.laser and enemy without checking for ship and enemy at the same time?
addEventListener(Event.ENTER_FRAME, collide);
function collide(event:Event)
{
if (enemy.hitTestObject(ship) )
{
gotoAndStop(2);
trace("hit Ship");
}
if (enemy.hitTestObject(ship.laser))
{
trace("hit laser");
gotoAndStop(3);
}
}