User Guide

78 Server-Side ActionScript Language Reference
Returns
A string.
Description
Method; reads the specified number of characters from a file and returns a string. The
operation will fail if the file is opened in binary mode.
Example
The following code opens a text file in read mode and sets variables for the first 100
characters, a line, and a byte:
if (myFileObject.open( "text", "read") ){
strVal = myFileObject.read(100);
strLine = myFileObject.readln();
strChar = myFileObject.readByte();
}
See also
File.readAll(), File.readByte(), File.readln()
File.readAll()
Availability
Flash Media Server 2.
Usage
fileObject.readAll()
Parameters
None.
Returns
An array.
Description
Method; reads the file after the location of the file pointer and returns an array with an
element for each line of the file. The operation fails if the file opened in binary mode.
See also
File.read(), File.readByte(), File.readln(), File.open()