Search tutorials
This is the easiest way to get keyboard movement. This tutorial was made for the complete newbie.
First, right click what you want to move by keyboard and click 'Convert To Symbol'. Choose 'Movie Clip'. For my example, I will use the name 'a'. Left Click on the Movie Clip and under properties, set the instance name to what you named it when you converted it to a symbol. Now double click on the Movie Clip, right click on it, and choose 'Convert To Symbol' again. This time, convert it to a button. Now make sure that you are editing the actions for the button, and not the movie clip. Add this to the actions for the button:
[speed] being the speed. For the smoothest movement, I suggest somewhere between one and ten.
First, right click what you want to move by keyboard and click 'Convert To Symbol'. Choose 'Movie Clip'. For my example, I will use the name 'a'. Left Click on the Movie Clip and under properties, set the instance name to what you named it when you converted it to a symbol. Now double click on the Movie Clip, right click on it, and choose 'Convert To Symbol' again. This time, convert it to a button. Now make sure that you are editing the actions for the button, and not the movie clip. Add this to the actions for the button:
on(keyPress "[instance name] obviously being what you named..the instance.") { [instance name]._x = [instance name]._x - [speed] } on(keyPress " ") { [instance name]._x = [instance name]._x + [speed] } on(keyPress " ") { [instance name]._y = [instance name]._y - [speed] } on(keyPress " ") { [instance name]._y = [instance name]._y + [speed] }
[speed] being the speed. For the smoothest movement, I suggest somewhere between one and ten.
| » Level Basic |
|
Added: 2002-08-09 Rating: 4 Votes: 142 |
| » Author |
| I am a VB programmer learning Flash. It seems interesting.. |
| » Download |
| Download the files used in this tutorial. |
| Download (0 kb) |
| » Forums |
| More help? Search our boards for quick answers! |
-
You must have javascript enabled in order to post comments.


Comments
There are no comments yet. Be the first to comment!