Trouble with html tags in htmlText = statement

Guys, I’ve got a puzzler. A friend is building a blog, with entries placed in a database, pulled out with php, and then passed to flash. It all goes well except for one thing…problems with html. She’s using a tutorial from webmonkey and here’s all the actionscript, as it originally was created:


//function to load external data using the loadVars() object
//l=name of loadVars object
//n=name of text field 
//t=trigger to decide whether to show all entries or just one.
//e= entry number to display (number)
//f=file to load from (string)
function lv(l, n, t, e, f) {
	sb.setSize(null, 200);
	sb2.setSize(null, 50);
	//create a new loadVars object if one doesn't already exist
	//if it does, use it
	if (l == undefined) {
		l = new LoadVars();
		l.onLoad = function() {
			var i;
			//clear out any text that might already be there
			n.htmlText = "";
			//to show a single entry at a time we use the
			//following code
			if (t == undefined) {
				n.htmlText += "<b>"+this["title"+e]+"  -  "+this["date"+e]+"</b><br><br>";
				n.htmlText += this["entry"+e];
			} else {
				//cycle through and show all entries
				for (i=0; i<this.n; i++) {
					n.htmlText += "<u><a href='asfunction:_root.loadArc,"+this["id"+i]+"'>"+this["title"+i]+"  -  "+this["date"+i]+"</a></u><br>";
				}
			}
			sb.update();
			sb2.update();
		};
	}
	l.load(f);
}

function loadArc(passed) {
	arcNum = passed-1;
	lv(blog_lv, entries_txt, undefined, arcNum, "blog.php");
}
//for the large entry textfield 
lv(blog_lv, entries_txt, undefined, 0, "blog.php"); 
//for the archives text field 
lv(archive_lv, archive_txt, "cycle", null, "blog.php");

the result: everything loaded in the .swf except the title of her entry over the entry itself. There is a bold html tag around that part, she removed it and voila! The title appeared. But now there’s another html tag that starts off a line of code, and it’s failing. Click on the entries, and nothing loads except the - between the date and title. Here is that section of code:


	for (i=0; i<this.n; i++) {
					n.htmlText += "<u><a href='asfunction:_root.loadArc,"+this["id"+i]+"'>"+this["title"+i]+"  -  "+this["date"+i]+"</a></u><br>";
				}

She found that by hardcoding a variable defined by the loadArc function, which is pulled in as arcNum, the whole thing works…but of course, can only pull in one entry with the one id number she coded. She also has removed the <u> tags, but the <a href must obviously remain to make her entries clickable.

Any clues why having html at the front of this statement in the for loop is causing the entire line to fail, and no variable to pass? It’s an interesting stumper. To see this in action, here is the page: http://www.lunesse.com/journal/journal.swf. In that directory you can also find the .fla file and the php results from the database. Tester.html is her second flash movie, also in that directory and completely barebones, and she received the exact same results.

Any pointers I could relay to her would be great. Thanks for your time.