Adobe Extending Flash Professional CS5 Manuale Utente Pagina 289

  • Scaricare
  • Aggiungi ai miei manuali
  • Stampa
  • Pagina
    / 565
  • Indice
  • SEGNALIBRI
  • Valutato. / 5. Basato su recensioni clienti
Vedere la pagina 288
267
EXTENDING FLASH PROFESSIONAL
FLfile object
Last updated 5/2/2011
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.
Results are unpredictable if the file or folder doesn’t exist. You should use FLfile.exists() before using this method.
Description
Method; 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:
RfileOrFolderURI is read-only
DfileOrFolderURI is a folder (directory)
HfileOrFolderURI is hidden (Windows only)
SfileOrFolderURI is a system file or folder (Windows only)
AfileOrFolderURI is ready for archiving (Windows only)
For example, if fileOrFolderURI is a hidden folder, the string returned is "DH".
Example
The 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!");
}
}
See also
FLfile.setAttributes()
Vedere la pagina 288
1 2 ... 284 285 286 287 288 289 290 291 292 293 294 ... 564 565

Commenti su questo manuale

Nessun commento