Admin Admin
Number of posts : 4 Registration date : 2008-05-06
| Subject: Arrow Key Movement Wed May 07, 2008 4:38 pm | |
| TUTORIAL ON ARROW KEY MOVEMENT(BASIC) Alright, so first create your movie clip. We're gonna call ours "player_mc." Now, place an instance of it on the Stage and give it an instance name "player_mc." Next, click on that movie clip and in the Actions panel, type this in:
- Code:
-
onClipEvent(enterFrame){ if(Key.isDown(Key.DOWN)){ this._y+=5; }if(Key,isDown(Key.UP)){ this._y-=5; }if(Key.isDown(Key.LEFT)){ this._x-=5; }if(Key.isDown(Key.RIGHT)){ this._x+=5; } }
| |
|