Hi, what I am trying to due is pull data from a database (got that working) and trying to display the data. I do no know how many records I will have so I need to do a for loop and create text boxes. So my test is as follows:
//create some formatting for our text box
myTextFormat = new TextFormat();
myTextFormat.font = "Verdana";
myTextFormat.size = 14;
myTextFormat.color=0x000000;//black
_root.xVal = 154;
_root.yVal = 216;
//create the items on page
for(_root.i = 0; _root.i < newrecordset.mRecordsAvailable; _root.i++)
{
//create a blank text box and set its parameters
_root.qualVal = "Quality" + _root.i;
_root.createTextField(_root.qualVal,20,_root.xVal,_root.yVal,108.4, 19.2);
_root.qualVal.background=true;
_root.qualVal.border=true;
_root.qualVal.backgroundColor=0xFFFFFF;//white
_root.qualVal.borderColor=0x000000;//black
_root.qualVal.text = "Test" + _root.i;
_root.qualVal.setNewTextFormat(myTextFormat);
_root.xVal += 109;
}
However, nothing shows up. I know it has to do with the name passed to createTextBox because if I just put "Quality" in instead of _root.qualVal it works (but then overwrites itself because it is in a loop, thus the need for a name with i involved.) Any help given will be appreciated.
Keith
The most likely way for the world to be destroyed, most experts agree, is by accident. That's where we come in; we're computer professionals. We cause accidents.
//create some formatting for our text box
myTextFormat = new TextFormat();
myTextFormat.font = "Verdana";
myTextFormat.size = 14;
myTextFormat.color=0x000000;//black
_root.xVal = 154;
_root.yVal = 216;
//create the items on page
for(_root.i = 0; _root.i < newrecordset.mRecordsAvailable; _root.i++)
{
//create a blank text box and set its parameters
_root.qualVal = "Quality" + _root.i;
_root.createTextField(_root.qualVal,20,_root.xVal,_root.yVal,108.4, 19.2);
_root.qualVal.background=true;
_root.qualVal.border=true;
_root.qualVal.backgroundColor=0xFFFFFF;//white
_root.qualVal.borderColor=0x000000;//black
_root.qualVal.text = "Test" + _root.i;
_root.qualVal.setNewTextFormat(myTextFormat);
_root.xVal += 109;
}
However, nothing shows up. I know it has to do with the name passed to createTextBox because if I just put "Quality" in instead of _root.qualVal it works (but then overwrites itself because it is in a loop, thus the need for a name with i involved.) Any help given will be appreciated.
Keith
The most likely way for the world to be destroyed, most experts agree, is by accident. That's where we come in; we're computer professionals. We cause accidents.