Adobe Extending Flash Professional CS5 Manual de usuario Pagina 287

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 565
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 286
265
EXTENDING FLASH PROFESSIONAL
FLfile object
Last updated 5/2/2011
Example
The following example makes a backup copy of a configuration file named config.ini and places it inside the same
folder in which it is located, with a new name:
var originalFileURI="file:///C|/Program Files/MyApp/config.ini";
var newFileURI="file:///C|/Program Files/MyApp/config_backup.ini";
FLfile.copy(originalFileURI, newFileURI);
If you prefer, you can perform the same task with a single command:
FLfile.copy("file:///C|:/Program Files/MyApp/config.ini", file:///C|/Program
Files/MyApp/config_backup.ini");
FLfile.createFolder()
Availability
Flash MX 2004 7.2.
Usage
FLfile.createFolder(folderURI)
Parameters
folderURI A folder URI that specifies the folder structure you want to create.
Returns
A Boolean value of true if successful; false if folderURI already exists.
Description
Method; creates one or more folders at the specified location.
You can create multiple folders at one time. For example, the following command creates both the MyData and the
TempData folders if they don’t already exist:
FLfile.createFolder("file:///c|/MyData/TempData")
Example
The following example creates a folder and a subfolder under the configuration folder (fl.configURI):
fl.trace(FLfile.createFolder(fl.configURI+"folder01/subfolder01"));
The following example attempts to create a folder called tempFolder at the root level on the C drive and displays an
alert box indicating whether the operation was successful:
var folderURI = "file:///c|/tempFolder";
if (FLfile.createFolder(folderURI)) {
alert("Created " + folderURI);
}
else {
alert(folderURI + " already exists");
}
Vista de pagina 286
1 2 ... 282 283 284 285 286 287 288 289 290 291 292 ... 564 565

Comentarios a estos manuales

Sin comentarios