Hello,
I need a folder list to be displayed in Flash.
Therefor I used a tut that explains how to do it.
I get the number of files,but I don’t get the filenames.
In PHP, they are displayed, but does anybody know how to display them in Flash.
I think it’s with a loop, but I don’t know how.
This is the PHP code :
<?php
$path = "thumb" . $_REQUEST[ 'path' ];
$output_string = '';
$file_number = 0;
$dir = dir( $path );
while ( false !== ( $file_name = $dir->read() ) ) {
if( $file_name[0] != '.' ){
$output_string .= "&file_" . ++$file_number . "=" . urlencode( $file_name );
}
}
$dir->close();
print "&file_count=$file_number&$output_string";
?>
and this is the AS :
dir = new LoadVars();
response = new LoadVars();
response.onLoad = getResponse;
dir.sendAndLoad("dircontent.php", response, "POST");
function getResponse( result ) {
file_count = response.file_count;// gives number of files
}
I found many posts about it, but no answers…