3 Replies Latest reply on Jan 19, 2011 6:07 PM by jordana309-36

    Referencing Non-existant variables

    jordana309-36 Level 1

      I need to create an array dynamically at runtime based on an unknown number of MXML objects. In this particular example, I have an unknown number of ToggleButton objects. I wanted to just put them in the array using push, in a structure like this:

       

      var btns:Array;

      btns.push(btn1);

      if(btn2!=null){

           btns.push(btn2)

      } if(btn3!=null){

           btns.push(btn3);

      }