Skip to main content
Known Participant
February 8, 2007
Answered

creating multiple textFields

  • February 8, 2007
  • 2 replies
  • 195 views
I thought I knew what I was doing.

I'm creating a logbook form that has about 500 different input textFields. Using a simple for loop, I trying to create a portion of the textFields then change their properties to an Input textFeild that is prepopulated with data.

Here's the code:

var maxColumns:Number = 10;
var maxRows:Number = 8;
var tc_TabOrderStart = 13;
var xStart:Number = 256;
var yStart:Number = 123;
var xOffset:Number = 46.3;
var yOffset:Number = 21.8;
var txtFieldWidth:Number = 41;
var txtFieldHeight:Number = 81;
for (var j:Number = 0; j<maxRows; j++)
{
for (var i:Number = 0; i<maxColumns; i++)
{
var tc_tfld:String = "tc"+j+"_"+i;
trace("tc_tfld = "+tc_tfld);
this.createTextField(tc_tfld, this.getNextHighestDepth(), xStart+(xOffset*i), yStart+(yOffset*j), txtFieldWidth, txtFieldHeight);
with (this.tc_tfld)
{
type="input";
text = "DUMB";
}
}
}

Thanks for any help. I've been stuck for three days.

This topic has been closed for replies.
Correct answer Peter Lorent
with (this[tc_tfld])

2 replies

logeyeAuthor
Known Participant
February 8, 2007
Excellent. Thank you LuigiL.
Peter LorentCorrect answer
Inspiring
February 8, 2007
with (this[tc_tfld])