.
Flash game moving controls
In this Flash actionscript tutorial you will see the basics of how to assign keyboard key values to move an object around, a very useful effect for games and other interactive flash projects.
First of we will draw or import an object to move around, I just imported mine as shown below.

Now right click your new object and convert it to a movie clip, in the properties panel give our new movie clip an instance name, I called mine move_obj.

Select your movie clip and hit F9 to get to the action script panel and type in the following code and I will explain below.

First we have an event handler called onClipEvent (enterframe) wrapped around our code, this event handler tells flash to "update" or repeat/check the code repeatly.
Then we have the same functionallity for 4 different keys, the up, down, left and right. An if statement telling flash, if one of those buttons is down, move the selected object from its position and add or subtract 15 px.
Its as simple as that.
Alex says: 2008-07-21
Admin Bob says: 2008-04-14
Twitch says: 2008-04-14
megha says: 2008-03-21
Admin Bob says: 2008-03-24
Admin Bob says: 2008-03-08
Frustrated says: 2008-03-07
dan says: 2008-03-02
EagleVision says: 2008-02-28
Admin Bob says: 2008-02-24
Stressed! says: 2008-02-24
Harrison says: 2008-02-21
Kaleem says: 2008-02-18
Drew says: 2008-02-13
OmegaNine says: 2008-02-12
OmegaNine says: 2008-02-12
Ketku says: 2008-02-11
Admin Bob says: 2008-02-09
dr pain says: 2008-02-06
jelly sac says: 2008-02-05
kazzzie says: 2008-02-02
Lemony says: 2008-02-02
haxan says: 2008-02-01
Dark says: 2008-01-31
Berishman says: 2008-01-31
casey says: 2008-01-27
Trav says: 2008-01-23
Jix says: 2008-01-09
Jix says: 2008-01-09
Karthik says: 2008-01-13

