Home / Flash / Moving Object Animation Using Actionscript in Flash Cs6

Generally using tween you can create any simple animation, In flash by using tween to make animation is one of method, and second one is  you can create any animation by using frame by frame arrange, this is take more time to create animation as well, and third method is actionscript this is the very technical and litte difficult by using script to make any animation, but if you can understand actionscript then it won’t be such a difficult to create animations. In my site I will disclose all the script easy technique and tips to make well. In this tutorial if you can consider, just we are trying to give keyboard movement, actually this script helps to you while building any games.

Creating instruction of Object Animation Using ActionScript:
1. First take new document actionscript 2.0.
2. Now take any object designed or draw anything as you like, after convert the object into Movie Clip, for that simply select object and then go to modify>and choose convert to symbol (f8 is direct key), here give the name and select Movie Clip.
3. Still you are selected object, now press F9 in keyboard and  type the actionscript as following below in that table.

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

For Testing output click following link or try below what shown the swf file image, first click on the image  and then press right and left arrow keys in keyboard for moving according, same like click up and  down arrow keys also as well (better to open in chrome to check for this link).

Moving Object Animation Using Actionscript Output

Sorry, either Adobe flash is not installed or you do not have it enabled

if you have any doubt or any comments about this ActionScript, just use our below comments section.


About Author Sudharsan

Chief Editor of Alldesigncreative.com, a designer, developer and animator. He spends most of the time to creating designs and animations includes visual effects. He loves so much to create all type of designing and has excellent knowledge in all kind of design roots.

Check Also

New Light Smoke Green Screen Effect

New Light Smoke Green Screen Effect

If you are searching for an innovative style of the new light smoke green screen ...

Leave a Reply