Adobe Extending Flash Professional CS4 Manual do Utilizador Página 290

  • Descarregar
  • Adicionar aos meus manuais
  • Imprimir
  • Página
    / 560
  • Índice
  • MARCADORES
  • Avaliado. / 5. Com base em avaliações de clientes
Vista de página 289
268
EXTENDING FLASH CS4 PROFESSIONAL
FLfile object
Description
Method; returns an array of strings representing the contents of the folder.
Examples
The following example returns three arrays. The first represents all the files in the C:\temp folder, the second
represents all the folders in the C:\temp folder, and the third represents the files and folders in the C:\temp folder:
var fileURI = "file:///C|/temp/" ;
var folderURI = "file:///C|/temp" ;
var fileList1 = FLfile.listFolder(fileURI, "files"); // files
var fileList2 = FLfile.listFolder(folderURI, "directories"); //folders
var fileList3 = FLfile.listFolder(folderURI); //files and folders
fl.trace("Files: " + fileList1);
fl.trace("");
fl.trace("Folders: " + fileList2);
fl.trace("");
fl.trace("Files and folders: " + fileList3);
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(folderURI + "/" + fileMask, "files");
if (list) {
alert(folderURI + " contains: " + list.join(" "));
}
The following example uses a file mask in the specified folderURI to return the names of all the executable files in the
Windows application folder:
var executables = FLfile.listFolder("file:///C|/WINDOWS/*.exe","files");
alert(executables.join("\n"));
FLfile.platformPathToURI()
Availability
Flash CS4 Professional.
Usage
FLfile.platformPathToURI(fileName)
Parameters
fileName A string, expressed in a platform-specific format, specifying the filename you want to convert.
Returns
A string expressed as a file:/// URI.
Description
Method; converts a filename in a platform-specific format to a file:/// URI.
Vista de página 289
1 2 ... 285 286 287 288 289 290 291 292 293 294 295 ... 559 560

Comentários a estes Manuais

Sem comentários