User Guide

170 Chapter 3: Objects
fl.fileExists()
Availability
Flash MX 2004.
Usage
fl.fileExists( fileURI )
Parameters
fileURI
A string that contains the path to the file.
Returns
A Boolean value: true if the file exists on disk; false otherwise.
Description
Method; checks whether a file already exists on disk.
Example
The following example outputs true or false to the Output panel for each specified file,
depending on whether the file exists.
alert(fl.fileExists("file:///C|/example.fla"));
alert(fl.fileExists("file:///C|/example.jsfl"));
alert(fl.fileExists(""));
fl.findDocumentIndex()
Availability
Flash MX 2004.
Usage
fl.findDocumentIndex( name )
Parameters
name
The document name for which you want to find the index. The document must be open.
Returns
An integer that is the index of the document.
Description
Method; finds the index of an open document with the specified name.
Example
The following example stores an indexed integer that represents the position of test.fla in the
fl.documents array in the docIndex variable. For example, if fl.documents[3] is test.fla, then
the value of
docIndex is 3.
var docIndex = fl.findDocumentIndex("test.fla");