User Guide
Using the Fireworks Object Model 11
Formatting nonstandard data types
In addition to the standard data types that can be passed to functions as arguments, or used as
properties, such as integer, string, and so on, Fireworks accepts other data types.
• Some functions accept values that are Fireworks objects. For an explanation of these objects,
see “The Fireworks Object Model” on page 9.
• Some functions accept a string in a specific format. Others accept value types that are not
Fireworks objects but are JavaScript object types that are specific to Fireworks. These types of
arguments are described next, in alphabetical order.
Color string data type
Functions that accept colors as arguments use the HTML syntax
"#rrggbb". You can
specify a color with an alpha (transparency) component by passing a longer string of the
form
"#rrggbbaa".
Mask data type
The format for a mask is
{maskBounds: rectangle, maskKind: string, maskEdgeMode:
string, featherAmount: int, maskData: hex-string}.
• maskBounds specifies the bounding rectangle of the mask area.
• Acceptable values for maskKind are "rectangle", "oval", "zlib compressed",
"rle compressed", or "uncompressed".
• If the value of maskKind is "rectangle" or "oval", the maskData string is ignored, and a
mask of the right shape is constructed that fills
maskBounds and that has the edge specified by
maskEdgeMode and featherAmount.
• If the value of maskKind is "zlib compressed", "rle compressed", or "uncompressed", the
maskData string is presumed to contain 8-bit mask data in hexadecimal format that precisely
matches the
maskBounds to define the mask.
Matrix data type
The format for a matrix is
{matrix: [float, float, float, float, float, float, float,
float, float]}
. This guide assumes that you know how to use these nine values to construct a
three-by-three transformation matrix; discussion of the construction of transformation matrices is
beyond the scope of this manual.
Point data type
The format for a point is
{x: float, y: float}. For instance, dom.addNewLine(startPoint,
endPoint)
could look like the following example:
fw.getDocumentDOM().addNewLine({x:64.5, y:279.5}, {x:393.5, y:421.5});
Rectangle data type
The format for a rectangle is
{left: float, top: float, right: float, bottom: float}.
For instance,
dom.addNewOval(boundingRectangle) could look like the following example:
fw.getDocumentDOM().addNewOval({left:72, top:79, right:236, bottom:228});