• All class derives from Object class.
  • Case sensitive
  • Compile mode: standard and strict (type checking at compile time)

  • // single line comment
  • /* multi-line comment */
  • Declaration: var varname:DataType [=value]
  • Array: var season:Array = ["spring", "summer", "fall", "winter"];
  • Constant: const VARNAME:DataType [=value]
  • XML: var employee:XML = <employee><firstName>Thomas</firstName><lastName>Jefferson</lastname></employee>;

Data TypesEdit

Primitive or Simple
  • String
  • Numeric:
    • Number (any number, integer or floating point -- 64-bit)
    • int (32 bits)
    • uint (32 bits)
  • Boolean': true, false
  • Array, Date and other classes

Untyped variable can have undefined value

  • var someObj:*;
  • var someObj;


  • optional
  • anything declare inside a package will have internal access modifier
   // import statements
   // variable, function, or statements declaration -- public and internal (global or package view)
   // class1 declaration and definition -- public and internal(default) only
   // class2 declaration (the definition has to be placed outside the package. This effectively makes class2 to be visible only through class1)


  • optional
  • applicable to function, variable, and constant. A class cannot be placed inside a custom namespace.
  • namespace and access modifier are mutually exclusive -- apply one or the other for function, vars or const.

  1. declare: [public/internal (if declare inside package)] namespace ns1; or namespace ns1="http://dummy/any/string";
  2. use: ns1 function myFunction() {}
  3. reference (to call myFunction):
    1. use namespace ns1;
    2. myFunction();
    or use name qualifier -- ns1::myFunction()

Variable ScopeEdit

  • global
  • class
  • function (this is the minimum; no local or block scope)


  • Explicit: Use int(xx), uint(xx), Boolean(xx), Number(xx) -- do this with strict mode compile


  • sealed -- like Java class
  • dynamic -- can have extra properties or methods added during runtime


ischeck data type and return true/false
ascheck data type and return object type or null
Community content is available under CC-BY-SA unless otherwise noted.