Wierd Bug in AS2

hi flash developers :hugegrin:
I’m a computer games development student, and currently I’m creating an action puzzle game using AS2 for my assignment

I design the game to be 1 level for 1 frame
And I have a problem when connecting 1 frame to another frame

When I run the frame separately there was no bug, it works just fine
But when I link it all together, I have a weird sound coming, sounds like “bzzzt”
and suddenly my main hero disappear from the screen

So I have something like this:

frame 3:

if (ball.hitTest(goal)) {
//Mouse.removeListener(con);
onEnterFrame=null;
gotoAndStop(4); //the position of the ball is recorded around goal
}

frame 4:

ball._x=0;//reset the position of the ball
ball._y=0;

I tried to debug this, and I traced the ball._x in onEnterFrame function
and this is the result that I got

1.7
514.25
154285.2
-34597890.2
-107374182.4
-107374182.4

such unbelievable numbers I have here
If any of you have encountered this bug before please help me
I can show you any part of my code if you need to see it, just ask for it
Thank you very much