Adobe 65011817 - Fireworks CS4 - Mac Extended User Manual page 306

Extending guide
Hide thumbs Also See for 65011817 - Fireworks CS4 - Mac:
Table of Contents

Advertisement

Last updated 12/8/2009
Function
BeginDragControlPoint()
DragControlPoint()
EndDragControlPoint()
SmartShapeEdited()
These functions correspond directly with the messages listed in
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
Configuration/Auto Shape Tools folders), you'll notice a
Shape 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.
You can see this
statement in each of the Auto Shape JavaScript files. Again, a single Auto Shape object may
switch
not need to process every message Fireworks sends, so only the useful messages are written into the JavaScript file
using the
qualifier. Effectively, the JavaScript file states in case of a certain message, or messages, perform the
case
following function.
In the Frame Auto Shape, this code is used to call
message:
"SmartShapeEdited"
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
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].RegisterMove(parms);
smartShape.elem.elements[0].contours[0].nodes[0].RegisterMove(parms);
break;
}
}
This function is called every time the mouse moves during a drag operation. Fireworks can
change the object as the user moves the mouse or wait until the mouse event ends to change
the object.
If the
BeginDragControlPoint()
will not call the
DragControlPoint()
Tells Fireworks how to draw the final Auto Shape, after a drag operation is complete. If Fireworks
handled shape changes through the
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()
PlaceControlPoints()
"ContourNode
object" on page 239), or wait until after a
function specifies control points or other points, Fireworks
function.
BeginDragControlPoint()
BeginDragControlPoint()
"Fireworks
messages" on page 300. To invoke your
statement.
switch()
statement near the beginning of the file. The Auto
when Fireworks sends a
EXTENDING FIREWORKS
Auto Shapes
function, then you can use
.
switch()
302

Advertisement

Table of Contents
loading

This manual is also suitable for:

Fireworks cs4

Table of Contents