User Guide

FLfile object 259
Examples
The following example checks for a file called mydata.txt and displays an alert box indicating
whether the file exists.
var fileURI = "file:///c|/temp/mydata.txt";
if (FLfile.exists(fileURI)) {
alert( fileURI + " exists!");
}
else {
alert( fileURI + " does not exist.");
}
The following example checks to see if a required configuration file exists. If the file doesnt
exist, it is created:
var configFile = "file:///C|/MyApplication/config.ini";
if (!FLfile.exists(configFile)) {
FLfile.write(configFile,"")
}
See also
FLfile.write()
FLfile.getAttributes()
Availability
Flash MX 2004 7.2.
Usage
FLfile.getAttributes( fileOrFolderURI )
Parameters
fileOrFolderURI A string, expressed as a file:/// URI, specifying the file or folder whose
attributes you want to retrieve.
Returns
A string that represents the attributes of the specified file or folder.
NOTE
Results are unpredictable if the file or folder doesn’t exist. You should use
FLfile.exists() before using this method.