2 Replies Latest reply on Feb 21, 2008 5:31 PM by VipersG

    Need help adding a child to a seperate component

    VipersG
      I know that the solution to this problem is going to be stupidly simple, or stupidly complex....

      So I'm trying to replicate windows functionality using Wietse Veenstra's SuperPanel.

      The main Application contains a menu bar which successfully opens the panels to the "desktop". An example of the code for this is as follows:
      quote:

      private function changeHandler(event:MenuEvent):void {

      if (event.item.@label == "Create New Supplier") {
      this.createdWindows += 1;
      var pHeight:Number = 460;
      var pWidth:Number = 710;
      var label:String = "Window No: ";
      var curNum:Number = this.numChildren + 1;
      var SFchild:SupplierForm = new SupplierForm();
      SFchild.title = label + curNum;
      SFchild.width = pWidth;
      SFchild.height = pHeight;
      SFchild.x = this.createdWindows * 50;
      SFchild.y = this.createdWindows * 50;
      this.addChild(SFchild);
      }


      The problem I am having is that I also want a superpanel to open another superpanel on the "desktop". Naturally I can't use my addChild() method as before, as that would simply create an instance of the second superpanel within the first superpanel...rather than as a child of the mainApp.

      I've been pulling my hair out all day and I can't find a way to fix this. Anyone care to lend a hand? Thanks....