3 Replies Latest reply on Oct 4, 2010 2:38 AM by Alex-Wright

    Accessing DisplayObjects made in a For Loop

    Alex-Wright

      Hi,

       

      I am making a form based on given data, and so would liek to display a variable number of formitems, and some of the formitems will have a varying number of radiobuttons.

       

      I would like to know how I can access the formitems (e.g. which radio button is selected), given that they are added to the application in a for loop using the addChild method, and so are not assigned to a constant variable. i.e

       

      for (f = 1 to numQuestions) {
      
           ...
           form_panel.addChild(text_input);
      
           for (c = 1 to numRadioButtons) {
      
                rButton = new RadioButton;
                rButton.label = externalData.getItemAt(c).question_option;
                form_panel.addChild(rButton);
      
           }
      
      }

       

      Thanks in advance,

       

        Alex.