File.open()

Availability

Flash Media Server 2.

Usage

fileObject.open("type","mode")

Parameters

type A string indicating the encoding type for the file. The following types are supported:

mode A string indicating the mode in which to open the file. The following modes are valid and can be combined (modes are case-sensitive and multiple modes must be separated by commas):

Returns

A Boolean value indicating whether the file opened successfully (true) or not (false).

Description

Method; opens a file so that you can read from it or write to it. First, you must create a file object and then call the open() method on that object. There are no default values for the type and mode parameters--values must be specified.

Example

The following if statement lets you insert code that executes when a text file is opened in read mode:

if (myFileObject.open("text", "read") ){
    // Do something here.
}