|
Flash CS4 Resources |
FLfile.getAttributes()Parameters
ReturnsA string that represents the attributes of the specified file or folder. Results are unpredictable if the file or folder doesn’t exist. You should use FLfile.exists() before using this method. DescriptionMethod; returns a string representing the attributes of the specified file or folder, or an empty string if the file has no specific attributes (that it, it is not read-only, not hidden, and so on). You should always use FLfile.exists() to test for the existence of a file or folder before using this method. Characters in the string represent the attributes as follows:
For example, if fileOrFolderURI is a hidden folder, the string returned is "DH". ExampleThe following example gets the attributes of the file mydata.txt and displays an alert box if the file is read-only. var URI = "file:///c|/temp/mydata.txt";
if (FLfile.exists(URI)){
var attr = FLfile.getAttributes(URI);
if (attr && (attr.indexOf("R") != -1)) { // Returned string contains R.
alert(URI + " is read only!");
}
}
|