Follow Flex After Dark on Twitter

Object-Oriented ActionScript

  • Polymorphism
  • Inheritance
  • Encapsulation

Classes and Interfaces

ActionScript requires classes/interfaces to be declared in a package and the explicit import of used classes/interfaces that are not in the same package.

Class Definition

ActionScript class definition:

package packageName
{
   import another.packageName.*;
   
   public class ClassName extends SuperClassName implements InterfaceName
   {
      public ClassName()
      {
         // constructor
      }
   }
}

ActionScript also supports dynamic classes.

Interface Definition

ActionScript interface definition:

package packageName
{
   public interface InterfaceName extends AnotherInterface
   {
      // public not necessary (and not allowed)
      function methodName():void;
   }
}

ActionScript Interfaces do not allow property definitions.

Polymorphism

Related Links:

Related Docs
Recent Docs
Random Docs
  • Flex Modules Flex Modules are compiled to dynamically-loadable SWF files that can be loaded and unloaded at run-time.
  • Flex Common Controls Overview of common Flex controls, including: Button, ComboBox, List, and TextArea.
  • ActionScript Alerts The ActionScript Alert control can be used to create interactive dialogs easily.
  • Flex Progress Bar The Flex Progress Bar control is used for displaying progress to users.
  • MXML Language Overview of the MXML programming language used by Flex.