Creating an Auto Shape
127
■
"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
). For more information, see
“SmartShape
object” on page 75
.
■
"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;
}
The following table lists all the available Fireworks message handler functions you can create
(although, you don’t have to write a response to every Fireworks message, only the ones
important to your Auto Shape):
Function
Description
InsertSmartShapeAt()
Draws the initial shape. This function is called 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. Define
all initial properties of the Auto Shape in this function.
BeginDragInsert()
Tells Fireworks what to do when the user drags an Auto Shape on
the canvas. You can define movements for control points and
nodes that you defined in
InsertSmartShapeAt()
.
Summary of Contents for FIREWORKS 8-EXTENDING FIREWORKS
Page 1: ...Extending Fireworks ...
Page 4: ...4 Contents ...
Page 358: ...358 Fireworks JavaScript API ...
Page 372: ...372 Index ...