5 Replies Latest reply on Jul 5, 2006 5:13 PM by jpwrunyan

    why does addChild(new Shape()) not work?

    jpwrunyan Level 1
      I would like to know why the following code does not work:

      private function doShape():void {
      var aShape:Shape = new Shape();
      <mx:Button click="doShape()" />

      according to the docs, addChild() takes a DisplayObject as a parameter. Shape is a DisplayObject. However, I get an error (#1034) that Shape can't be converted to mx.core.IUIComponent

      I don't understand what the problem is...