![MACROMEDIA FLASH 8-EXTENDING FLASH Manual Download Page 266](http://html1.mh-extra.com/html/macromedia/flash-8-extending-flash/flash-8-extending-flash_manual_3348049266.webp)
266
Objects
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.read()
Availability
Flash MX 2004 7.2.
Usage
FFLfile.read()
Parameters
fileOrFolderURI
A string, expressed as a file:/// URI, specifying the file or folder whose
attributes you want to retrieve.
Returns
The contents of the specified file as a string, or
null
if the read fails.
Description
Method; returns the contents of the specified file as a string, or
null
if the read fails.
Examples
The following example reads the file mydata.txt and, if successful, displays an alert box with
the contents of the file.
var fileURI = "file:///c|/temp/mydata.txt";
var str = FLfile.read( fileURI);
if (str) {
alert( f " contains: " + str);
}
The following example reads the ActionScript code from a class file and stores it in the
code
variable:
var classFileURI = "file:///C|/MyApplication/TextCarousel.as";
var code = Flfile.read(classFileURI);
Summary of Contents for FLASH 8-EXTENDING FLASH
Page 1: ...Extending Flash...
Page 38: ...38 Top Level Functions and Methods...
Page 532: ...532 Objects...
Page 554: ...554 C Level Extensibility...