Hmm, well I tried it but it still didn't work. I guess it's not the onClipEvent(load) that is causing the problem I'm having. Ok, I guess I'll start explaining and hope for some help. :P
If the scene with the engine is NOT the first scene in the movie, the character always goes to a frame when he's not supposed to. For instance, the character is not moving, but he's in the running animation. If I set it back to the first scene, everything works fine. Here's the code.
onClipEvent(load){
scale = _xscale;
isJumping = false;
jumpSpeed = 0;
time = 0;
fallSpeed = 0;
falling = true;
}
onClipEvent(enterFrame){
if(Key.isDown(Key.LEFT)){
_xscale = -scale;
this._x=_x-10
}
if(Key.isDown(Key.RIGHT)){
_xscale = +scale;
this._x=_x+10
}
if(Key.isDown(Key.RIGHT)||Key.isDown(Key.LEFT)){
gotoAndStop(2);
}else{
gotoAndStop(1);
}
if(isJumping == true){
gotoAndStop(3);
time+=1;
this._y-=jumpSpeed
jumpSpeed = 15;
}
if(Key.isDown(Key.UP)){
isJumping = true;
}
if(_root.plat.hitTest(_root.player._x, _root.player._y, true)){
isJumping = false;
falling = false;
time = 0;
fallSpeed = 0;
if(Key.isDown(Key.UP)){
isJumping = true;
}
}else{
falling = true
}
if(falling == true){
this._y+=fallSpeed
fallSpeed+=1;
if(fallSpeed == 20){
gotoAndStop(3);
}
}
}
onClipEvent(keyUp){
gotoAndStop(1);
}
Note:This is the code to the actual player movie clip.
By the way, I didn't copy and paste. :P
Thanks in advance!