Parsing External Array Data Tutorial - Help!

I’m having trouble with this tutorial here.

My actionscript is exactly the same, but I’ve added a dynamic text field and some traces to help debug:


files = new Array();
lv = new LoadVars();
lv.onLoad = function() {
	trace("loaded");
	fl = this.filelist;
	trace("filelist " + fl);
	files = fl.split(",");
	c = files.length - 1;
	trace("c="+c);
	for (i = 0; i < c; i++) {
		trace("file " + files*);
		fileName_txt.text = files*; // dynamic text field
	}
};
lv.load("files.php");

My php reads the ‘img’ directory, again exactly the same otherwise:


<?php 
if  ($handle  =  opendir('img'))  { 
echo  "filelist=";
while  (false  !==  ($file  =  readdir($handle)))  { 
$ext  =  substr(strrchr($file,  "."),  1);
if  ($file  !=  "."  &&  $file  !=  ".."  &&  $ext  ==  "jpg")  { 
echo  "$file";
echo  ",";
}
} 
closedir($handle);
echo  "null";
} 
?>

When I trace ‘fl’ it comes back undefined, but I’m not very good at php so I can’t figure out what’s wrong. Can someone help?

Adam