I create dynamic text boxes populated by XML:
_xb1 = _xt1-10;
_xb2 = _xb1+4;
_yb1 = _yt1+7;
_yb2 = _yb1+4;
my_xml = new XML();
my_xml.ignoreWhite = true;
my_xml.onLoad = function(success) {
if (success) {
makeTextbox(this);
findHeight();
}
};
my_xml.load("bullet_list4b.xml");
textFormat1 = new TextFormat();
textFormat1.font = "Verdana";
textFormat1.size = 12;
textFormat1.color = 0x000000;
function makeTextbox(xml_load) {
content1 = xml_load.firstChild.firstChild.childNodes;
//trace (content);
for (i=0; i<content1.length; i++) {
//trace (content*.attributes.message);
for (j=0; j<20; j++) {
megaMan.createTextField("textBox"+j, j+10, 0, 0, 370, 125);
megaMan["textBox"+j].multiline = true;
megaMan["textBox"+j].wordWrap = true;
megaMan["textBox"+j].autoSize = "left";
megaMan["textBox"+j].selectable = false;
megaMan["textBox"+j].html = true;
megaMan["textBox"+j].htmlText = content1[j];
megaMan["textBox"+j].setTextFormat(textFormat1);
megaMan["textBox"+j]._x = content1[j].attributes.xray;
for (k=0; k<20; k++) {
megaMan.createEmptyMovieClip("theBullet"+k, 100+k);
megaMan["theBullet"+k].lineStyle(1, 0x000000, 100);
megaMan["theBullet"+k].beginFill(0x000000, 100);
megaMan["theBullet"+k].moveTo(_xb1, _yb1);
megaMan["theBullet"+k].lineTo(_xb2, _yb1);
megaMan["theBullet"+k].lineTo(_xb2, _yb2);
megaMan["theBullet"+k].lineTo(_xb1, _yb2);
megaMan["theBullet"+k].endFill();
megaMan["theBullet"+k]._x = content1[k].attributes.xray;
}
}
}
}
I try to determine the height of the boxes so they can list under one another.
Why does this loop work in player 6 but not 7?
It returns NaN. How do I get it to see the loop as a number?
function findHeight() {
tb1 = megaMan.textBox0._height;
for (r=1; r<20; r++) {
dec=r-1;
_root["tb"+r] = (_root["tb"+dec]) + (megaMan["textBox"+dec])._height;
//trace(_root["tb"+r]);
}
for (s=0; s<20; s++) {
megaMan["textBox"+s]._y = _root["tb"+s];
megaMan["theBullet"+s]._y = _root["tb"+s];
megaMan["theBullet"+s]._visible = content1[s].attributes.seen;
}
}
Thanks