actionscript Getting started with actionscript

30% OFF - 9th Anniversary discount on Entity Framework Extensions until December 15 with code: ZZZANNIVERSARY9


Actionscript formerly developed by Macromedia Inc., which now have been acquired by Adobe Systems Inc. is a powerful object-oriented programming language based on ECMAScript. Initially created with very limited set of navigation controls like play(), stop(), gotoAndPlay() etc., usually used for 2D vector based animation and required Actionscript Virtual Machine(AVM) like Flash Player for execution, have now evolved into a robost and flexible programming language ideal for rapid rich internet application development, capable of hardware accelerated rendering with Stage3D, targeting not only Flash Player, but also Adobe AIR based desktop and mobile platforms.


VersionRelease Date
Flash 4 actions1999-01-01
Actionscript 12000-09-01
Actionscript 22003-09-01
Actionscript 32006-06-27


Hello World Example

ActionScript 2.0:

_root.createTextField("message", 0, 5, 5, 300, 50);
var tf:TextFormat = new TextFormat(); 
tf.color = 0xFF0000;
tf.size = 32;
tf.bold = true;
message.text = "Hello World!"; 

First function creates a TextField named "message" in the depth 0 of the _root(MainTimeline) at coordinates (5,5) having dimensions 300x50, where unit is pixel.

Then we create an instance of TextFormat class and assign color, size and bold properties and apply it to the TextField using second function to make our TextField red with fontsize 32 pixels and bold.

Finally, we assign the text property of our newly created TextField to "Hello World!".

ActionScript 3.0:

import flash.text.TextField;
import flash.text.TextFormat;

var message:TextField = new TextField();
message.x = message.y = 5;
message.width = 300;
message.height = 50;

var tf:TextFormat = new TextFormat(); 
tf.color = 0xFF0000;
tf.size = 32;
tf.bold = true;

message.defaultTextFormat = tf;
message.text = "Hello World!";

Both of the above examples should output something like this:

enter image description here

Installation or Setup

Detailed instructions on getting actionscript set up or installed.

Got any actionscript Question?