User Guide
130 Auto Shapes
You can also invoke a single function for several messages:
case "BeginDragInsert":
case "InsertSmartShapeAt":
InsertSmartShapeAt(true);
break;
Supporting functions and methods
Because the Auto Shape file is written in JavaScript, your functions can use global variables,
common functions, and the Fireworks JavaScript API. The Auto Shape JavaScript file
contains the definition of the shape’s points, and a series of functions to handle the Fireworks
messages as the user interacts with the shape. The file also includes a series of commands and
functions defining the shape’s properties and other functionality. These functions are often
separate from the message handling functions so they can be used by multiple message
handling functions. For example, the Cog Auto Shape JavaScript file (Configuration/Auto
Shapes/Cog.jsf) contains user-defined functions near the bottom of the file. These functions
perform calculations and create shapes that are useful for the message handling functions. The
top of the file contains a series of variable statements that define useful values for tooltips,
global variables, and constants used throughout the Auto Shape JavaScript file.
You can use the Fireworks JavaScript API and the Fireworks Object Model, along with
efficient JavaScript coding practices, to create effective Auto Shapes (and continue to reuse the
most useful functions from each Auto Shape JavaScript file). For more information, see
“Fireworks JavaScript API” on page 131 and the “The Fireworks Object Model” on page 9.