beautypg.com

Fl.fileexists(), Fl.finddocumentdom(), This property in conjunction with – Adobe Extending Flash Professional CS5 User Manual

Page 254: To specify a particular document for an action

background image

232

EXTENDING FLASH PROFESSIONAL

flash object (fl)

Last updated 5/2/2011

fl.fileExists()

Availability
Flash MX 2004.

Usage

fl.fileExists(fileURI)

Parameters

fileURI

A string, expressed as a file:/// URI, 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 displays

true

or

false

in 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.findDocumentDOM()

Availability
Flash CS3 Professional.

Usage

fl.findDocumentDOM(id)

Parameters

id

An integer that represents a unique identifier for a document.

Returns
A Document object, or

null

if no document exists with the specified id.

Description
Method; lets you target a specific file by using its unique identifier (instead of its index value, for example). Use this
method in conjunction with

document.id

.

Example
The following example illustrates reading a document’s ID and then using it to target that document:

This manual is related to the following products: