Accessing a Fireworks document
All the functions listed in
object, which represents a Fireworks document. To perform a function on a Document
object, you must first get the Document Object Model (DOM) of the document. You then
call the functions as methods of that DOM.
You can use methods that operate on a document's DOM only on open documents.
To use a DOM function with a document other than the active document, use the
following syntax; note that
document the command will affect.
fw.documents[documentIndex].functionName();
To use a DOM function with the active document, use
fw.getDocumentDOM().functionName()
fw.getDocumentDOM()
Passing values
For all properties that are not read-only, you can pass values to change elements of a
document. For example, the following command sets the fifth brush in the third open
document to a square shape:
fw.documents[2].brushes[4].shape = "square";
The preceding example includes the following properties:
is a property of the Fireworks object and contains an array of
documents
Document objects.
is a property of the Document object and contains an array of Brush objects.
brushes
is a property of the Brush object.
shape
Throughout this manual, optional arguments are enclosed in {braces}.
Fireworks Object Model calls and API calls
In some cases, you can use Fireworks Object Model calls or API calls to perform the same
operations. In other cases, a certain function might be available in either the Fireworks Object
Model or the API, but not in both.
10
The Fireworks Object Model
"Document functions" on page 132
documentIndex
).
are methods of the Document
is a zero-based index that specifies which
(for more information, see
Need help?
Do you have a question about the FIREWORKS 8-EXTENDING FIREWORKS and is the answer not in the manual?