for (var i = 0; i<2; i++) { trace(i); createTextField("txtBox",i,0,0,200,20); txtBox.text=i; txtBox.border = true; txtBox._y = i*spacing; }