1 Reply Latest reply on Jan 28, 2007 12:21 AM by AximX5User

    Adding MXML components

    AximX5User
      Can someone clarify something for me?

      I have a component that is an HBox. It has a couple of bindable variables, and lots layouts., and i called it MyNewHBox.

      in my main app file, I wanted to loop through in the script section, and add X number of MyNewHBox 's into my application tabnavigation, yet i can't figure out how to do it. In the code below, i wanted to add 5 new MyNewHBoxes to my tab navigator but it keeps erroring out. Whats the correct syntax? MyNewHBox.mxml is in the root.

      import MyNewHBox;

      function loadHBoxes:void {

      var newBox:MyNewHBox; // this line errors out
      for (y = 0; y < 5; y++) {
      newBox = new MyNewHBox;
      newBox.customName = "My Name is " + y;
      tabNav.addchild(MyNewH);
      }

      }

      Thanks in advance for the help!