1 Reply Latest reply on Jan 28, 2010 12:39 AM by Yennick_Trevels

    Dynamically Create HBox in loop?

    trainsimple

      How can I do this in a for loop?

       

      var tab2:HBox = new HBox();

      tab2.label = webcastTypesArray[2].Name;

      addChild(tab2);

       

      Something like this doesn't work:

       

      for(var i:int; i<webcastTypesArray.length;i++)

      {

      var tab[i]:HBox = new HBox();

      tab[i].label = webcastTypesArray[i].Name;

      addChild(tab[i]);

      }

       

      Please help! Thanks!!!