Cross-product architecture
83
RPC and the Fireworks JavaScript DOM
The RPC server does not allow for self-discovery of the server classes and their methods. Instead
the client must know the methods and properties of a given class of objects beforehand. If the
client is written in ActionScript or C++, then the client can use the generated client stubs
provided by Macromedia, Inc. Client stubs generated by Macromedia know about all methods
and properties of every class accessible through RPC. These stubs are available for download at
the Macromedia website:
www.macromedia.com/support/fireworks/documentation.html
.
Generating stubs for nonstandard client types
If the client is not written in one of the languages for which Macromedia provides a client RPC
library, the client implementer must create or generate the stubs. For information about how to
do this, see
Chapter 2, “The Fireworks Object Model,” on page 9
. The application object (with
object ID fw) is of the
Fireworks
class (see
“Object IDs” on page 79
for other objects with
reserved IDs). All objects returned by the server contain the class name as an attribute. Given an
object’s class, the client can determine what methods and properties it has based on the Fireworks
JavaScript DOM. 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. So, several of the documented types collapse to one RPC type.
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.
The following table shows the mapping between the Fireworks Object Model data types and the
RPC data types.
4
No such property. The property that the client requested does not exist on the
specified object.
5
Read-only property. The
set
request cannot be completed because the specified
property is read only.
6
Wrong number of parameters. The request did not specify the correct number of
parameters. Either more or fewer parameters are needed.
7
Wrong parameter type. One or more of the parameters given is of the wrong type.
DOM data type RPC data type Example
Description
array
array
<array></array>
Types map identically.
Boolean
Boolean
<bool value="true" />
Both types are identical. Both
contain only two values:
true
or
false
.
color
string
<string
value="#7788CCFF" />
A color is a string with nine
characters. It has the format
#RRGGBBAA.
Error code Description
Содержание DREAMWEAVER MX 2004-EXTENDING DREAMWEAVER
Страница 1: ...Extending Fireworks...
Страница 4: ...4 Contents...
Страница 8: ...8 Chapter 1 Extending Fireworks Overview...
Страница 102: ...102 Chapter 4 Auto Shapes...
Страница 284: ...284 Chapter 5 Fireworks JavaScript API...