FLfile object
265
FLfile.listFolder()
Availability
Flash MX 2004 7.2.
Usage
FLfile.listFolder(
folderURI
[,
filesOrDirectories
] )
Parameters
folderURI
A string, expressed as a file:/// URI, specifying the folder whose contents you
want to retrieve. You can include a wildcard mask as part of
folderURI
. Valid wildcards
are * (matches one or more characters) and ? (matches a single character).
filesOrDirectories
An optional string that specifies whether to return only filenames or
only folder (directory) names. If omitted, both filenames and folder names are returned.
Acceptable values are
"files"
and
"directories"
.
Returns
An array of strings representing the contents of the folder, or
false
if the folder doesn’t exist.
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(fol "/" + fileMask, "files");
if (list) {
alert(fol " contains: " + list.join(" "));
}
Summary of Contents for FLASH 8-EXTENDING FLASH
Page 1: ...Extending Flash...
Page 38: ...38 Top Level Functions and Methods...
Page 532: ...532 Objects...
Page 554: ...554 C Level Extensibility...