MACROMEDIA FIREWORKS MX 2004-EXTENDING FIREWORKS Manual page 97

Extending fireworks
Hide thumbs Also See for FIREWORKS MX 2004-EXTENDING FIREWORKS:
Table of Contents

Advertisement

// Set the new point's values
node.x = node.predX = node.succX = x;
node.y = node.predY = node.succY = y;
}
You can then simplify the
function InsertSmartShapeAt()
{
var elem = smartShape.elem;
var newPath = new Path;
elem.elements[0] = newPath;
newPath.contours[0] = new Contour;
var contour = newPath.contours[0];
var i = 0;
addPathPoint(contour, i++, 0, 0);
addPathPoint(contour, i++, 200, 0);
addPathPoint(contour, i++, 200, 125);
addPathPoint(contour, i++, 0, 125);
contour.isClosed = true;
}
Adding control points
After selecting an Auto Shape in a document, the user can click its control points to adjust the
object. You must define the control points for your Auto Shape before you can define what
happens to the object when the user manipulates them.
The following code adds a single control point to the coordinates (0, 0):
smartShape.elem.controlPoints.length++;
// Establish the new control point
var cp=smartShape.elem.controlPoints[smartShape.elem.controlPoints.length-1];
// Place the Control Point
cp.x = 0;
cp.y = 0;
Handling the user interaction
After you define the Auto Shape properties and control points, you need to tell Fireworks how to
handle user interactions with the Auto Shape. To facilitate the interaction of the user with the
Auto Shape, Fireworks sends a series of messages to the Auto Shape object as the user performs
certain operations on the Auto Shape. You can write a series of functions to respond to
these messages.
InsertSmartShapeAt()
function with the new helper function:
Creating an Auto Shape
97

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FIREWORKS MX 2004-EXTENDING FIREWORKS and is the answer not in the manual?

Questions and answers

This manual is also suitable for:

Fireworks mx 2004

Table of Contents