Actionscript Code not working - connecting to MySQL

Hi,
I did a tutorial on how to connect a Flash Dynamic text box to a MySQL database. I created a PHP file which connects to the database and displays fine. The tricky part has been getting Flash to display the results in the PHP file. Here is my AS code. If anyone can see what I am doing wrong can you help please. Much appreciated.


//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["date"+e]+"  -  "+this["location"+e]+"</b><br><br>";
				n.htmlText += this["comment"+e];
			} else {
				//cycle through and show all entries
				for (i=0; i<this.n; i++) {
					n.txt.htmlText += "<u><a href='asfunction:_root.loadArc,"+this["id"+i]+"'>"+this["date"+i]+"  -  "+this["location"+i]+"</a></u><br>";
				}
			}
			sb.update();
			sb2.update();
		};
	}
	l.load(f);
	
	function loadArc(passed) {
	arcNum = passed-1;
	lv(entries_lv, entries_txt, undefined, arcNum, "../php/shows-query.php");
	//for the large entry textfield 
lv(entries_lv, entries_txt, undefined, 0, "../php/shows-query.php"); 
//for the archives text field 
lv(archive_lv, archive_txt, "cycle", null, "../php/shows-query.php");


	}
	
}

Thank you
Kay

a

looks very complicated, can you give the url of the output generated by php?

for sure… sorry I should have done that.

http://www.yokocasionos.com/php/shows-query.php

If you need the actual php code I can post it when I get home. the output page of the flash file is here as well:

flash output page

You can see from this page that no information is being picked up at all, even resizing the scrollbar etc.

Cheers
Michael

i saw some double &-signs thats not “good”…

simple version would be like this (i think), if this works you can change the trace functions for somthing to add the text…

lv = new LoadVars();
lv.load(“http://www.yokocasionos.com/php/shows-query.php”);
lv.onLoad = function(succes)
{
****if(succes)
****{
********for(var i = 0; i < this.n; i++){
****************trace(this[“date” + i]);
****************trace(this[“location” + i]);
****************trace(this[“comment” + i]);
****}
****else
****{
******* trace(“Loading Error!!”);
*** }
}