stop();
shipX = 20;
speed = 10;
function update() {
ship_mc._x = shipX;
}
function checkKeys() {
if (Key.isDown(Key.RIGHT)) {
shipX += speed;
ship_mc.gotoAndStop(1);
}
else if (Key.isDown(Key.LEFT)){
shipX -= speed;
ship_mc.gotoAndStop(2);
}
else if (Key.isDown(Key.SPACE));{
speed = 1
}
}
onEnterFrame = function () {
checkKeys();
update();
};
but speed is now always 1.
WHY?