1 Reply Latest reply on Nov 2, 2009 12:04 PM by Flex harUI

    Extends DisplayObject directly?

    lifesting

      Hi, gurus.  Currently I'am building a framework to edit graphical shapes like Eclipse GEF.  After serveral tests, I decide to choose DisplayObject as the Root figure, because it has provided a few foundmental functions like Bound/Event Dispatcher/Transformer etc.. On the language reference it says DisplayOjbect is an abstract class, you can't instantiate it, but I found inheriting from it is also disallowed, for example:

       

      public class Figure extends DisplayObject
          {
              public function Figure()
              {
                  super();
              }
              public function paint(g:Graphics):void{
                  g.beginFill(0x3344ff);
                  g.drawRect(this.x, this.y, this.width,this.height);
                  g.endFill();   
              }

       

          }

       

      Why? Is there any ways to avoid this silly designment?

       

      Thanks for your help!