Read this thoroughly explained, detailed flash lesson and see how to create fast basketball moving using the Action Script code and arrows key. You can use this animation for some flash banner or for some presentation. Using this lesson, you will also learn how to import any image into a flash stage, how to convert it into a movie clip symbol, how to apply action script code on it and much more!
Example:
Use the arrows key on the keyboard to move the icon!
Step 1
First, download png basketball icon.
Step 2
Create a new flash document. Press Ctrl+J key on the keyboard (Document Properties) and set the dimensions of your document as whatever you like. Select any color as background color. Set your Flash movie's frame rate to 36 and click ok.
Step 3
Choose now File > Import > Import to stage (Ctrl+R) and import the icon of basketball that you just saved in step 1, into a flash stage.
Step 4
While the icon is still selected, hit F8 key (Convert to Symbol) to convert it into a Movie Clip Symbol.

Step 5
Select the Selection Tool (V) and click once on the icon to select it. After that, go to the action script panel (F9) and enter this code inside the actions panel:
onClipEvent (load) {
power = 14;
}
onClipEvent (enterFrame) {
if (Key.isDown(Key.LEFT)) {
_x -= power;
}
if (Key.isDown(Key.RIGHT)) {
_x += power;
}
if (Key.isDown(Key.UP)) {
_y -=power;
}
if (Key.isDown(Key.DOWN)) {
_y +=power;
}
}
We're done now!
Test your movie and enjoy!
Download source file (.fla)