98
Chapter 4: Auto Shapes
Fireworks messages
Fireworks passes the following messages to the SmartShape object as the user interacts with
(inserts, moves, or changes) the shape:
•
"InsertSmartShapeAt"
Fireworks sends this message when the user selects the shape from the Tools panel and clicks on
the canvas, or drags the shape from the Auto Shapes panel to the canvas.
•
"BeginDragInsert"
Fireworks sends this message when the user drags an Auto Shape onto the canvas. This message
defines a more specific action than the “InsertSmartShapeAt” message.
•
"DragInsert"
Fireworks sends this message every time the mouse moves during a drag operation (as long as
smartshape.getsDragEvents is set to
true
). See
“SmartShape object” on page 60
.
•
"EndDragInsert"
Fireworks sends this message on a
mouseUp
event after a drag operation.
•
"BeginDragControlPoint"
Fireworks sends this message when the user clicks and holds the mouse button on a
control point.
•
"DragControlPoint"
Fireworks sends this message every time the mouse moves during a drag operation (as long as
smartshape.getsDragEvents is set to
true
). See
“SmartShape object” on page 60
.
•
"EndDragControlPoint"
Fireworks sends this message when the drag operation is complete.
•
"SmartShapeEdited"
Fireworks sends this message when any change has been made to the Auto Shape (for example,
when the user deletes a node).
Message handler functions
Because Fireworks sends interaction messages as the user interacts with the Auto Shape, you can
write functions to define, edit, and delete the Auto Shape and its properties. Specifically, you
write functions defining the effect of manipulating the control points on the shape properties.
You can define object properties at various stages of a drag operation: at the beginning of the
operation, during the operation, and at its end. (If you define only the properties for the end
result, Fireworks waits until the drag operation ends to show the changes to the user.) For
example, to have your Auto Shape respond to an “EndDragControlPoint” message, you would
write the following function:
function EndDragControlPoint(){
cp.x = smartShape.currentMousePos;
cp.y = smartShape.currentMousePos;
}
Summary of Contents for DREAMWEAVER MX 2004-EXTENDING DREAMWEAVER
Page 1: ...Extending Fireworks...
Page 4: ...4 Contents...
Page 8: ...8 Chapter 1 Extending Fireworks Overview...
Page 102: ...102 Chapter 4 Auto Shapes...