Adobe 65011817 Extended User Guide - Page 307
Supporting functions and methods
UPC - 883919157368
View all Adobe 65011817 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 307 highlights
Last updated 12/8/2009 EXTENDING FIREWORKS 303 Auto Shapes switch(smartShape.operation) { case "BeginDragInsert": case "InsertSmartShapeAt": InsertSmartShapeAt(true); break; case "BeginDragControlPoint": BeginDragControlPoint(); break; case "DragControlPoint": DragControlPoint(); break; case "EndDragControlPoint": EndDragControlPoint(); break; case "SmartShapeEdited": PlaceControlPoints(); break; } You don't need a response for every message Fireworks sends; but you do need to make sure the switch statement handles the responses required by your shape. 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 tool tips, 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 "Additional Fireworks Functions" on page 315 and the "The Fireworks Object Model" on page 6.