Adobe 38039927 - Fireworks CS3 - PC Extended User Manual page 284

Extending fireworks
Hide thumbs Also See for 38039927 - Fireworks CS3 - PC:
Table of Contents

Advertisement

Function
BeginDragCon-
trolPoint()
DragControlPoint()
EndDragCon-
trolPoint()
SmartShapeEdited()
These functions correspond directly with the messages listed in "Fireworks messages" on page 278. To invoke your
own function names in response to Fireworks messages, you need to write a
Switch statements
If you take a look at some existing Auto Shapes (in the Configuration/Auto Shapes folder and in the Configu-
ration/Auto Shape Tools folders), you'll notice a
JavaScript code in these files uses a
statement sorts the messages sent by Fireworks so each message (that is useful to the particular Auto Shape) invokes
a corresponding function.
Description
Tells Fireworks what to do when the user clicks and holds the mouse button on a
control point. Fireworks can change the object as the user moves the mouse (for
example, using the RegisterMove method of the SmartShape object; for more
information about how to get the properties of a smartShape object, see
"ContourNode object" on page 211), or wait until after a mouse event to change
the object.
The following example uses the RegisterMove method to set the properties for the
object on the mouse-down event so that the user can preview changes during the
drag operation:
function BeginDragControlPoint()
{
switch (smartShape.currentControlPointIndex) {
case 0:
var parms = smartShape.GetDefaultMoveParms();
smartShape.elem.controlPoints[0].Register-
Move(parms);
smart-
Shape.elem.elements[0].contours[0].nodes[0].Regis-
terMove(parms);
break;
}
}
This function is called every time the mouse moves during a drag operation. Fire-
works can change the object as the user moves the mouse or wait until the mouse
event ends to change the object.
If the
BeginDragControlPoint()
points, Fireworks will not call the
Tells Fireworks how to draw the final Auto Shape, after a drag operation is
complete. If Fireworks handled shape changes through the
trolPoint()
function, then you can use the end result of that function as a
starting point. In that case, the code need not reflect every change in shape, but
just the changes that aren't handled by
This function is called when any changes have been made to the Auto Shape that
might change the shape's behavior (such as removing a node inside an Auto
Shape object).
switch()
statement as the initial message handler in the file. The
switch()
function specifies control points or other
DragControlPoint()
function.
BeginDragCon-
BeginDragControlPoint()
switch()
statement near the beginning of the file. The Auto Shape
ADOBE FIREWORKS CS3
Extending Guide
.
statement.
switch()
280

Advertisement

Table of Contents
loading

This manual is also suitable for:

Fireworks cs3

Table of Contents