|
-
Collision Detection Error
I'm working on AS3 to make collision detection between two MC. Two instance names are ball and king_stage.
I wrote on frame 1:
stop();
import flash.events.Event;
king_stage.addEventListener(Event.ENTER_FRAME, targetHit);
function targetHit(event:Event):void {
if (king_stage.hitTestObject(ball)) {
gotoAndStop(1, "Scene 2");
}
}
It works but message like this. I don't know why. Please help.
Error message :
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at stop_jump_game_bomb2_fla::MainTimeline/targetHit()
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|