These scripts should be put in the 'ship' movie clip. I believe they are all correct but since I haven't been able to check them, write back if there's a problem.
// THIS SCRIPT ASSUMES YOU WANT THE SHIP TO MOVE WHILE THE UP AND DOWN BUTTONS ARE BEING HELD.
onClipEvent (load)
speed = 2
// The higher you set the variable speed, the faster the ship will move.
}
onClipEvent (enterFrame)
if (Key.isDown(Key.UP) && !Key.isDown(Key.DOWN)
setProperty("_root.ship", _y, ("_root.ship", _y) - speed);
}
if (Key.isDown(Key.DOWN) && !Key.isDown(Key.UP)
setProperty("_root.ship", _y, ("_root.ship", _y) + speed);
}
}
// THIS SCRIPT ASSUMES YOU WANT THE SHIP TO MOVE EACH TIME THE UP AND DOWN BUTTONS ARE PRESSED.
onClipEvent (load)
speed = 2
// The higher you set the variable speed, the faster the ship will move.
}
onClipEvent (keyDown) {
if (Key.getCode(Key.DOWN))
setProperty("_root.ship", _y, ("_root.ship", _y) + speed);
}
if (Key.getCode(Key.UP))
setProperty("_root.ship", _y, ("_root.ship", _y) - speed);
}
}
// THIS SCRIPT ASSUMES YOU WANT THE SHIP TO MOVE WITH THE MOUSE.
onClipEvent (enterFrame)
setProperty("_root.ship", _y, _ymouse);
}