ActionScript Basics
ActionScript is essential part of the Flex SDK. When I first saw the syntax of ActionScript(AS) I first noticed the c-style syntax and its object oriented nature. I take my time and do a research and found out that AS is a dialect of EMCAScript(Javascript). For seasoned programmer you may find AS easy to learn, but for the sake of others I will share some of the basic syntax. I'm expecting that you know basic of object oriented programming or else this post is useless for you.
import declaration used to access packages that contains class to be used in your application
syntax: import (package)
ex. import mx.controls.Alert;
Variable declaration used to store temporary data
syntax: (access modifier) var (name) : (data type);
ex. protected var testname:String = "test string";
Function declaration used to group certain task in your application.
syntax: (access modifier) function (name)(parameters):(return type) { //block of code }
ex.
protected function btnLogin_clickHandler(event:MouseEvent):void{
Alert.show("Hello World", "Dialog Box",mx.controls.Alert.OK);
}














