Class Objects : Class « Class « Flash / Flex / ActionScript






Class Objects

 

package {
  import flash.system.*;
  import flash.display.Sprite;
  public class Main extends Sprite{
    public function Main(){

      var vp = MyClass;
      var pet = new vp();
    }
  }
}


  class MyClass {
    private var pet;

    public function MyClass (  ) {
       trace("constructor");
    }
  }

        








Related examples in the same category

1.Define a class
2.Define class with properties
3.Convert class to the more general type without writing any explicit code.