
ADOBE FLASH MEDIA INTERACTIVE SERVER
Server-Side ActionScript Language Reference
54
Availability
Flash Media Server 2
Parameters
numChars A number specifying the number of characters to read. If numChars specifies more bytes than are left
in the file, the method reads to the end of the file.
Returns
A string.
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();
}
File.readAll()
fileObject.readAll()
Reads the file after the location of the file pointer and returns an Array object with an element for each line of the
file. If the file opened in binary mode., the operation fails. When this method fails, it invokes the
appli-
cation.onStatus()
event handler to report errors.
Availability
Flash Media Server 2
Returns
An Array object.
File.readByte()
fileObject.readByte()
Reads the next byte from the file and returns the numeric value of the next byte or -1 if the operation fails. If the file
is not opened in binary mode, the operation fails.
Availability
Flash Media Server 2
Returns
A number; either a positive integer or -1.
File.readln()
fileObject.readln()
Reads the next line from the file and returns it as a string. The line-separator characters (either \r\n on Windows or
\n on Linux) are not included in the string. The character \r is skipped; \n determines the actual end of the line. If
the file opened in binary mode, the operation fails.
Commenti su questo manuale