MACROMEDIA FLASH 8-EXTENDING FLASH Manual page 265

Extending flash
Table of Contents

Advertisement

FLfile.listFolder()
Availability
Flash MX 2004 7.2.
Usage
FLfile.listFolder( folderURI [, filesOrDirectories ] )
Parameters
A string, expressed as a file:/// URI, specifying the folder whose contents you
folderURI
want to retrieve. You can include a wildcard mask as part of
. Valid wildcards
folderURI
are * (matches one or more characters) and ? (matches a single character).
An optional string that specifies whether to return only filenames or
filesOrDirectories
only folder (directory) names. If omitted, both filenames and folder names are returned.
Acceptable values are
and
.
"files"
"directories"
Returns
An array of strings representing the contents of the folder, or
if the folder doesn't exist.
false
Description
Method; returns an array of strings that represent the contents of the folder, or an empty array
if the folder doesn't exist.
Examples
The following example returns an array representing the files, folders, or both files and folders
in the Program Files directory.
var folderURI = "file:///C|/WINDOWS/Program Files" ;
var fileList = FLfile.listFolder(folderURI, "files") // files
var fileList = FLfile.listFolder("folderURI", "directories") //folders
var fileList = FLfile.listFolder(folderURI) //files and folders
The following example returns an array of all the text (.txt) files in the temp folder and
displays the list in an alert box.
var folderURI = "file:///c|/temp";
var fileMask = "*.txt";
var list = FLfile.listFolder(folderURI + "/" + fileMask, "files");
if (list) {
alert(folderURI + " contains: " + list.join(" "));
}
FLfile object
265

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLASH 8-EXTENDING FLASH and is the answer not in the manual?

Questions and answers

This manual is also suitable for:

Flash 8

Table of Contents