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

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -