Detailed instructions for use are in the User's Guide.
[. . . ] Extending Fireworks
Trademarks 1 Step RoboPDF, ActiveEdit, ActiveTest, Authorware, Blue Sky Software, Blue Sky, Breeze, Breezo, Captivate, Central, ColdFusion, Contribute, Database Explorer, Director, Dreamweaver, Fireworks, Flash, FlashCast, FlashHelp, Flash Lite, FlashPaper, Flash Video Encoder, Flex, Flex Builder, Fontographer, FreeHand, Generator, HomeSite, JRun, MacRecorder, Macromedia, MXML, RoboEngine, RoboHelp, RoboInfo, RoboPDF, Roundtrip, Roundtrip HTML, Shockwave, SoundEdit, Studio MX, UltraDev, and WebHelp are either registered trademarks or trademarks of Macromedia, Inc. and may be registered in the United States or in other jurisdictions including internationally. Other product names, logos, designs, titles, words, or phrases mentioned within this publication may be trademarks, service marks, or trade names of Macromedia, Inc. or other entities and may be registered in certain jurisdictions including internationally. [. . . ] The DOM document also gives the prototypes of the methods and properties of a class. The client can use the DOM document to determine the number and types of method parameters. The DOM document uses more types in its prototypes than the RPC mechanism defines. In addition to static properties, objects of certain classes can also have dynamic properties. Chapter 2, "The Fireworks Object Model, " on page 9 documents dynamic properties and specifies whether the dynamic properties are read only. Most dynamic properties are on lists (for example, the BehaviorsList class). The properties take an integer or string as a property name, and return a value based on the element associated with the property name.
Cross-product architecture
107
The following table shows the mapping between the Fireworks Object Model data types and the RPC data types.
DOM data type
array Boolean
RPC data type
array Boolean
Example
<array></array> <bool value="true" />
Description
Types map identically. A date is a dictionary with the following subelement keys: year, month, day, hour, minutes, and seconds. All six elements are integer data types.
color
string
<string value="#7788CCFF" />
date
dictionary
<dict> <int key="year" value="2002" /> <int key="month" value="9" /> <int key="day" value="3" /> <int key="hour" value="20" /> <int key="minutes" value="15" /> <int key="seconds" value="32" /> </dict> <dict></dict> <double value="5. 132" /> <int value="7" /> <dict> <array key="matrix"> <double value="1. 0" /> <double value="0. 0" /> <double value="0. 0" /> <double value="0. 0" /> <double value="1. 0" /> <double value="0. 0" /> <double value="0. 0" /> <double value="0. 0" /> <double value="1. 0" /> </array> </dict> <null />
dictionary float integer matrix
dictionary float integer dictionary
Types map identically. The elements start at the top row and go in row-major order.
null
null
Types map identically.
108
Cross-Product Extensions
DOM data type
object
RPC data type
Example
Description
For an object type, the client can simply specify a server object. However, for certain objects (such as objects of the Effect class) a dictionary can be constructed and then used. If the client creates a dictionary, all properties of the class must be added to the dictionary with the correct type. A rect is a dictionary with four subelement keys: top, left, bottom, and right. All four subelements are float data types.
server object, or <obj value="1" /> dictionary
point
dictionary
<dict> <double key="x" value="300. 4" /> <double key="y" value="234. 0" /> </dict> <dict> <double key="top" value="300. 4" /> <double key="left" value="234. 0" /> <double key="bottom" value="500. 6" /> <double key="right" value="564. 0" /> </dict> <dict> <string key="units" value="inch" /> <double key="pixelsPerUnit" value="72. 0" /> </dict>
rect
dictionary
resolution
dictionary
A resolution is a dictionary with two subelement keys: units and pixelsPerUnit. The units key can be any of these strings: inch, cm, or pixels. The pixelsPerUnit key is a float data type.
string URL
string string
<string value="foo" /> Types map identically. <string value="file://hd/www" /> <void />
A URL is a string. Types map identically.
void
void
Cross-product architecture
109
Security
The RPC server restricts some operations to make sure that a client cannot use the RPC server maliciously to damage the user's system. The first security mechanism is that the RPC server binds to the loopback address, 127. 0. 0. 1. This means all clients must run on the same computer as the RPC server and must connect to that computer through the loopback address. The second security mechanism prevents the exposure of "dangerous" classes that are normally on the Fireworks Javascript DOM, such as the JavaScript Files classes. However, the client can still have Fireworks open, and export and save PNG and other image files. Third, certain methods and properties that could be used maliciously are not permitted in remote procedure calls (including all methods of the File object, see "Files object" on page 19 and the functions fw. launchApp and fw. findApp). [. . . ] If bHide is false, the panels are visible.
Returns
Nothing.
Description
Shows or hides the panels. This behavior is the same as the Tab key behavior.
fw. setPref()
Availability
Fireworks 3.
Usage
fw. setPref(prefname, prefval)
Arguments
and prefval A complete list of these values is beyond the scope of this documentation, but the format of prefname and prefval exactly matches those in the Fireworks Preferences file. To return the value that is associated with a Preference key, use
prefname fw. getPref().
342
Fireworks JavaScript API
Returns
Nothing.
Description
Sets the value that is associated with the specified Preference key.
See also
fw. getPref()
fw. setUpFindReplace()
Availability
Fireworks 3.
Usage
fw. setUpFindReplace(findSpec)
Arguments
findSpec
A Find object (see "Find object" on page 23).
Returns
Nothing.
Description
Sets up a search.
fw. toggleFloater()
Availability
Fireworks 3.
Usage
fw. toggleFloater(panelName)
Fireworks functions
343
Arguments
panelName
Acceptable values are "find", "project log", "object", "info", "url",
"effect", "history", "mixer", "fill", "stroke", "swatches", "layers", "frames", "behaviors", "optimize", "library", "styles", "optimized colors", "options",
and "toolbox".
Any panels not specified in the list of valid arguments (like those in the Command Panels folder which are "outside" the Fireworks application) should be named exactly as they appear in the file system without their file extension. For example, the valid argument name for the Align panel (Align. swf) is "Align", and a valid name for a custom panel file mypanel. swf would be "mypanel".
NO TE
Returns
Nothing.
Description
Shows or hides the specified panel, or makes it topmost. [. . . ]