User Guide
20 Chapter 1: Introduction
The flash object contains the following child objects:
The Document object
An important property of the top-level
flash object is the documents property. The documents
property contains an array of Document objects that each represent one of the FLA files currently
open in the authoring environment. The properties of each Document object represent most of
the elements that a FLA file can contain. Therefore, a large portion of the DOM is composed of
child objects and properties of the
Document object.
To refer to the first open document, for example, use the statement
flash.documents[0]. or
fl.documents[0]. The first document is the first Flash document that was opened during the
current session in the authoring environment. When the first opened document is closed, the
indexes of the other open documents are decremented.
To find a particular document's index use
fl.findDocumentIndex(nameOfDocument).
To access the document that is currently focused, use the statement
flash.getDocumentDOM() or
fl.getDocumentDOM(). The latter is the syntax used in most of the examples in this document.
To find a particular document in the
documents array, iterate through the array and test each
document for its
name property.
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.
Tools object
fl.tools is an object that has a toolObjs property. The toolObjs
property is an array of
toolObj objects. Each toolObj object represents
a tool in the Flash Tools panel.
ToolObj object Use fl.
tools.toolObjs to retrieve an array of all tool objects (see
tools.toolObjs); use fl.tools.activeTool to access the currently
active tool object (see
tools.activeTool).
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.