9
2
CHAPTER 2
The Fireworks Object Model
If you want to extend the functionality of Macromedia Fireworks 8 by writing or modifying a
JavaScript extensibility file, you must become familiar with the objects that Fireworks makes
available through JavaScript. The hierarchy of these objects comprises the Fireworks Object
Model, which contains the following major components:
■
Six global methods that are available from any part of the application and need not be
declared as methods of a particular object. For more information, see
“Global methods”
on page 12
.
■
Six core objects: Dialogs, Document, Errors, Files, Find, and System. For more
information, see
“Core objects” on page 13
. (The App object that was used in Fireworks 3
is supported for backward compatibility, but its use is deprecated in favor of the Fireworks
object.)
■
The Fireworks object (for more information, see
“The Fireworks object” on page 26
).
■
Numerous objects associated with Fireworks documents, such as ExportOptions, Guides,
Path, Image, and Text. For more information, see
“Objects within Fireworks documents”
on page 32
.
■
A set of objects that you can use to specify the format of HTML code when exporting
from Fireworks. For more information, see
“HTML export objects” on page 80
.
Using the Fireworks Object Model
When scripting extensions for Fireworks, you write JavaScript commands that send calls to
the Fireworks Object Model to determine or change the current settings for a Fireworks
document. For example, the following command calls the Fireworks object (
fw
) to obtain the
path to the Export Settings directory (
appExportSettingsDir)
, which is expressed as a file:/
/URL. In other words,
fw
references the Fireworks global object, of which
appExportSettingsDir
is a property (for more information, see
“The Fireworks object”
on page 26
), so a JavaScript command can assign the resulting value to a variable, as follows:
var expSetDir = fw.appExportSettingsDir;
Summary of Contents for FIREWORKS 8-EXTENDING FIREWORKS
Page 1: ...Extending Fireworks ...
Page 4: ...4 Contents ...
Page 358: ...358 Fireworks JavaScript API ...
Page 372: ...372 Index ...