actionscript 3 - Why can't extend DisplayObject then instantiate -
the displayobject class can extended extended class cannot instantiated.
class:
package{ import flash.display.displayobject; class extended extends displayobject{ public function extended(){ super() } } }
main timeline:
var e:extended=new extended(); addchild(e);
error:
argumenterror: error #2012: extended$ class cannot instantiated.
please read documentation of displayobject
class:
the displayobject class not include apis rendering content onscreen. reason, if want create custom subclass of displayobject class, want extend 1 of subclasses have apis rendering content onscreen, such shape, sprite, bitmap, simplebutton, textfield, or movieclip class.
Comments
Post a Comment