4 Replies Latest reply on Dec 6, 2008 5:49 PM by WIDS-Chris

    Looping createTextField Issue

    WIDS-Chris Level 1
      Hello all, I havent done too much with looping, so I have a question.

      I am trying to create a text field at runtime and then loop it for say 10 times. creating the loop I can do, where I am having my issue is using the created text fields.

      ///////////////////////////////////////////////////////////////////////////////

      posLR = 10;
      posUD = 90;
      loopVar = 0;
      nameVar = "Testing" + loopVar;


      do {
      this.createTextField(nameVar, this.getNextHighestDepth(), posLR, posUD, 300, 20);
      Testing0.text = "text test 1";
      loopVar++
      posUD = posUD + 20;
      } while (loopVar < 10);

      ///////////////////////////////////////////////////////////////////////////////

      the above code creates the first text box, but I dont want to have to say Testing0.text = "...", Testing1.text = "...", ect.

      How do I use these text boxes the correct way (Do I need to use an Array) I wouldnt even know where to start (I know less about Arrays then Loops).

      Thanks fro the Help
      ~Chris