Simple example of a class file

The following is a simple example of a class file called MyComponent.as. This example contains a minimal set of imports, methods, and declarations for a component that inherits from the UIObject class.

import mx.core.UIObject;

  class myPackage.MyComponent extends UIObject {
  static var symbolName:String = "MyComponent";
  static var symbolOwner:Object = Object(myPackage.MyComponent);
  var className:String = "MyComponent";
  #include "../core/ComponentVersion.as"
  function MyComponent() {
  }
  function init(Void):Void {
    super.init();
  }
  function size(Void):Void {
    super.size();
  }
}