3 Replies Latest reply: Aug 8, 2012 4:52 AM by Ned Murphy RSS

    creating a dynamic text box inside a movieclip using a for loop

    jencarter

      I am having issues creating several dynamic text boxes inside a movieclip using a for loop.  I am using AS 2.  Here is the code I have created thus far

       

      var leading:Number = 0;

      function drawClip():Void

      {

          this.createEmptyMovieClip("mc", 10);

          for(i=0;i<5;i++)

          {

              mc.createTextField("textBoxes" + i, this.getNextHighestDepth(), 0, leading, 200, 200)

              mc["textBoxes" + i].text = i;

              leading += 20;

          }

      }

      drawClip();

       

      It does create a mc but only display the number 5

       

      Any thoughts?