Creating An Auto Shape - MACROMEDIA FIREWORKS 8-EXTENDING FIREWORKS Manual

Table of Contents

Advertisement

You can create Auto Shape icons for the Tools panel or Auto Shapes panel in PNG, JPG, or
GIF format. For the Tools panel, the icon image should be 16 x 16 pixels (if the image is
larger than 16 x 16 pixels, Fireworks scales the image to fit in the Tools panel). For the Auto
Shapes panel, the Auto Shape icon should be 60 x 60 pixels. If the image for the Auto Shapes
panel is smaller, or larger, than 60 x 60 pixels, Fireworks will not scale the image—the icon
will appear centered in its cell, but not sized to fit, so it may appear cropped if it is too large.
If the icon is missing (or named incorrectly) then Fireworks does not display an icon.
However, if the Auto Shapes folder has an icon with the same name as a shape in the
Auto Shape Tools folder, then that icon will be used in the Tools panel.

Creating an Auto Shape

To create an Auto Shape, you need to define a series of properties for the shape, define the
shape's control points, and write functions that tell Fireworks how to handle the Auto Shape
as the user interacts with the object (for more information, see
interaction" on page
Defining the shape
The following code creates the initial shape, a rectangle (a more concise way of creating an
initial shape follows this example):
function InsertSmartShapeAt()
{
smartShape.elem.elements[0] = new Path;
smartShape.elem.elements[0].contours[0] = new Contour;
smartShape.elem.elements[0].contours[0].nodes[0] = new ContourNode;
smartShape.elem.elements[0].contours[0].nodes[0].predX = 0;
smartShape.elem.elements[0].contours[0].nodes[0].predY = 0;
smartShape.elem.elements[0].contours[0].nodes[0].x = 0;
smartShape.elem.elements[0].contours[0].nodes[0].y = 0;
smartShape.elem.elements[0].contours[0].nodes[0].succX = 0;
smartShape.elem.elements[0].contours[0].nodes[0].succY = 0;
smartShape.elem.elements[0].contours[0].nodes[1] = new ContourNode;
smartShape.elem.elements[0].contours[0].nodes[1].predX = 200;
smartShape.elem.elements[0].contours[0].nodes[1].predY = 0;
smartShape.elem.elements[0].contours[0].nodes[1].x = 200;
smartShape.elem.elements[0].contours[0].nodes[1].y = 0;
smartShape.elem.elements[0].contours[0].nodes[1].succX = 200;
smartShape.elem.elements[0].contours[0].nodes[1].succY = 0;
smartShape.elem.elements[0].contours[0].nodes[2] = new ContourNode;
smartShape.elem.elements[0].contours[0].nodes[2].predX = 200;
smartShape.elem.elements[0].contours[0].nodes[2].predY = 125;
smartShape.elem.elements[0].contours[0].nodes[2].x = 200;
124
Auto Shapes
126).
"Handling the user

Advertisement

Table of Contents
loading
Need help?

Need help?

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

Questions and answers

Subscribe to Our Youtube Channel

This manual is also suitable for:

Fireworks 8

Table of Contents