Flash WOLF
Would you like to react to this message? Create an account in a few clicks or log in to continue.
Flash WOLF

Learn Flash Together!
 
HomeLatest imagesSearchRegisterLog in

 

 Easy Arrowed Control!

Go down 
AuthorMessage
DDWOLFER
Admin



Posts : 4
Join date : 2008-07-15
Location : On an island! duh!

Easy Arrowed Control! Empty
PostSubject: Easy Arrowed Control!   Easy Arrowed Control! Icon_minitimeTue Jul 15, 2008 7:59 am

Hey,

This is going to teach you how to move a movieclip using the arrow keys.

First to start off make the object you want to move, I guess thats what you would call it. Then highligth the object and press F8 and name it what ever you want, I named mine "chara_cnt" with out the quotes. Once you do that highlight the object again and press F9 to bring up Action Script 2.0, and copy and paste this code.

onClipEvent(enterFrame){
if(Key.isDown(Key.RIGHT)){
this._x += 5;
}
if(Key.isDown(Key.LEFT)){
this._x -= 5;
}
if(Key.isDown(Key.UP)){
this._y -= 5;
}
if(Key.isDown(Key.DOWN)){
this._y += 5;
}
}


Then test out the movie by pressing Ctrl and Enter at the same time. It should work. If you have a question just post it here.

Thanks, Smile
DDWOLFER
Back to top Go down
https://flashwolf.forumotion.com
 
Easy Arrowed Control!
Back to top 
Page 1 of 1

Permissions in this forum:You cannot reply to topics in this forum
Flash WOLF :: Flash CS3 Pro :: ActionScript 2.0-
Jump to: