dimanche 31 mai 2015

Why can't extend DisplayObject then instantiate

The DisplayObject class can be extended but the extended class cannot be instantiated.

Class:

package{
  class Extended extends DisplayObject{

              import flash.display.DisplayObject;


   public function Extended(){
      super()

    }

  }
}

Main timeline:

var e:Extended=new Extended();

addChild(e);

Error:

ArgumentError: Error #2012: Extended$ class cannot be instantiated.

Aucun commentaire:

Enregistrer un commentaire