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;
mc.createTextField("textBoxes" + i, this.getNextHighestDepth(), 0, leading, 200, 200)
mc["textBoxes" + i].text = i;
leading += 20;
It does create a mc but only display the number 5
You are cionstantly overwriting the previously created textfield due to using the wrong depth definer. You are pointing to "this" to get a depth value, but planting it inside "mc", so it is always going to the same depth since "this" 's depth index doesn't change. Use...
mc.createTextField("textBoxes" + i, mc.getNextHighestDepth(), 0, leading, 200, 200)