
65
SERVER-SIDE ACTIONSCRIPT LANGUAGE REFERENCE FOR ADOBE MEDIA SERVER 5.0.1
Server-Side ActionScript Language Reference
Last updated 7/2/2013
Availability
Flash Media Server 2
File.read()
fileObject.read(numChars)
Reads the specified number of characters from a file and returns a string. If the file is opened in binary mode, the
operation fails. When this method fails, it invokes the
application.onStatus() event handler to report errors.
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
application.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 -1if the operation fails. If the file is
not opened in binary mode, the operation fails.
Availability
Flash Media Server 2
Komentarze do niniejszej Instrukcji