The function hitTestObject detects if one object hits another object. One problem is that the event is considered to occur if the bounding rectangles of the two objects touch. In ActionScript the asteroid has hit the planet, even though it does not look like they are touching.

There is no code in the movie, all of the code is in the Asteroid.as