Adobe FLEX 2-PROGRAMMING ACTIONSCRIPT 3.0 Manual page 400

Programming actionscript 3.0
Table of Contents

Advertisement

$files = array();
while ($file = readdir($directory))
{
array_push($files, array('./images/'.$file, filectime('./images/
'.$file)));
}
usort($files, sorter);
if (count($files) > $MAXIMUM_FILE_COUNT)
{
$files_to_delete = array_splice($files, 0, count($files) -
$MAXIMUM_FILE_COUNT);
for ($i = 0; $i < count($files_to_delete); $i++)
{
unlink($files_to_delete[$i][0]);
}
}
print_r($files);
closedir($directory);
function sorter($a, $b)
{
if ($a[1] == $b[1])
{
return 0;
}
else
{
return ($a[1] < $b[1]) ? -1 : 1;
}
}
?>
You can pass additional variables to the upload script using either the
method. To send additional
code:
var fileRef:FileReference = new FileReference();
fileRef.addEventListener(Event.SELECT, selectHandler);
fileRef.addEventListener(Event.COMPLETE, completeHandler);
fileRef.browse();
function selectHandler(event:Event):void
{
var params:URLVariables = new URLVariables();
params.date = new Date();
params.ssid = "94103-1394-2345";
var request:URLRequest = new URLRequest("http://www.yourdomain.com/
FileReferenceUpload/fileupload.cfm");
request.method = URLRequestMethod.POST;
request.data = params;
fileRef.upload(request, "Custom1");
400
Networking and Communication
variables to your upload script, you can use the following
POST
or
request
POST
GET

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLEX 2-PROGRAMMING ACTIONSCRIPT 3.0 and is the answer not in the manual?

This manual is also suitable for:

Flex

Table of Contents