User Guide

104 Chapter 5: Fireworks JavaScript API
Palette or panel
Several API functions reference the History panel (see “History panel functions” on page 278).
Throughout the Fireworks documentation and online help, the term “palette” is reserved for
discussions of a color palette, and the term “panel” is used to refer to the floating windows that are
available within Fireworks. Therefore, when the function name contains “palette,” the
descriptions refer to a “panel.
Document functions
As discussed in an earlier section,, you get and set document properties by calling functions as
methods of the documents Document Object Model (DOM) (see Accessing a Fireworks
document” on page 10). Methods that operate on a document’s DOM are listed in this section as
dom.functionName(). However, you cannot simply type dom.functionName(). In place of dom,
you must type
fw.getDocumentDOM() or fw.documents[documentIndex]. For example:
How a function looks in this manual: dom.addNewHotspot()
How you must type it:
fw.getDocumentDOM().addNewHotspot(); // operates on active document
or
fw.documents[documentIndex].addNewHotspot(); // operates on specified
document
dom.addBehavior()
Availability
Fireworks 3.
Usage
dom.addBehavior(action, event, eventIndex)
Arguments
action
A string that specifies the behavior to be added, such as "MM_swapImageRestore()".
For a list of all the behaviors that can be added, see “Using the dom.addBehavior() function
on page 105.
event The event that triggers the behavior. Acceptable values are "onMouseOver",
"onMouseOut", "onLoad", and "onClick".
eventIndex An integer value that specifies the location where the behavior should be added,
starting with
0 (although, to specify the end location, pass –1 here).
Returns
Nothing.
Description
Adds a specified behavior to the selected Hotspots and slices.