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 List Controls Flex List controls refer to a special group of controls that display collections of items, usually from a data provider.
  • Flex Progress Bar The Flex Progress Bar control is used for displaying progress to users.
  • ActionScript XML ActionScript has powerful XML support via E4X.
  • Flex HTTP Service Flex provides an HTTP Service in its RPC (Remoting) package for standard HTTP operations.
  • Flex Embedding Assets Overview of embedding assets in Flex applications.