User Guide

14 Introduction
The Flash Document Object Model
The Flash Document Object Model (DOM) for the Flash JavaScript API consists of a set of
top-level functions (see “Top-Level Functions and Methods” on page 23) and two top-level
objects—the FLfile object and the flash object (fl). Each object is guaranteed to be available to
a script because it always exists when the Flash authoring environment is open. For more
information, see FLfile object and flash object (fl).
When referring to the flash object, you can use
flash or fl. For example, to close all open
files, you can use either of the following statements:
flash.closeAll();
fl.closeAll();
The flash object contains the following child objects:
Object How to access
componentsPanel object Use
fl.componentsPanel to access the componentsPanel object.
This object corresponds to the Components panel in the Flash
authoring environment.
Document object Use
fl.documents to retrieve an array of all the open documents;
use
fl.documents[index] to access a particular document; use
fl.getDocumentDOM() to access the current document (the one
with focus).
drawingLayer object Use
fl.drawingLayer to access the drawingLayer object.
Effect object Use
fl.effects to retrieve an array of effect descriptors that
corresponds to the effects registered when Flash starts; use
fl.effects[index] to access a particular effect; use
fl.activeEffect to access the effect descriptor for the current
effect being applied.
Math object Use
fl.Math to access the Math object.
outputPanel object Use
fl.outputPanel to access the outputPanel object. This object
corresponds to the Output panel in the Flash authoring
environment.
Project object Use
fl.getProject() to return a Project object for the currently
open project.
Tools object Use
fl.tools to access an array of Tools objects.
XMLUI object Use
fl.xmlui to access an XML User Interface (XMLUI) object.
The XMLUI object provides the ability to get and set properties of
an XMLUI dialog box.