At 11/30/08 10:30 PM, biohasard wrote:
how do i make a mc (spaceship) move when i use the arrow keys... im a little stuck in doing it every tutorial i have found it doesn't seem to work. please help!
give the mc an instance name Spaceship (to do this select the MC and in the prroperties it says instance name)
then select the frame on the main timeline and press f9 and type
var Speed:Number = 5;
onEnterFrame = function(){
spaceship._x += Key.isDown(Key.RIGHT)*speed;
spaceship._x -= Key.isDown(Key.LEFT)*speed;
spaceship._y += Key.isDown(Key.DOWN)*speed;
spaceship._y -= Key.isDown(Key.UP)*speed;
}