Combined Code
movieClip 2 {
}
instance of movieClip 2 {
onClipEvent (load) {
speed = 6;
isJumping = false;
jumpSpeed = 0;
startY = _y;
scale = _xscale;
}
onClipEvent (enterFrame) {
if (isJumping) {
_y = _y + jumpSpeed;
jumpSpeed += 1;
if (_y >= startY) {
_y = startY;
isJumping = false;
speed = 6;
}
} else {
if (Key.isDown(32)) {
isJumping = true;
jumpSpeed = -15;
speed = 6;
}
}
if (Key.isDown(37)) {
play();
_x = _x - speed;
_xscale = -scale;
} else {
if (Key.isDown(39)) {
play();
_x = _x + speed;
_xscale = scale;
} else {
stop();
}
}
}
}