Macromedia Flash developers can create interactive movies that contain a combination of ActionScript and calls to the Fireworks API for two types of deployment: interactive panels or modal commands. Basically, while writing ActionScript, you can embed commands for the Fireworks API in the MMExecute() function, or you can embed them using the API wrapper extension for Macromedia Flash (download the API wrapper from the Macromedia website at www.macromedia.com/go/fw_documentation). You can construct these Macromedia Flash animations as interactive panels that work just as the Layers panel, the Frames panel, and other built-in panels do.
Shockwave files that are published to the Fireworks MX installation directory, Configuration\Command Panels folder, act as panels in the Fireworks interface at runtime and are available through the Window menu.
Shockwave files that are published to the Configuration\Commands folder act as modal commands and are available through the Commands menu in the Fireworks interface.
Note: On multiuser systems, Fireworks supports a Command Panels folder inside of each user's Configuration folder, so users can save favorite panels.
At runtime, Fireworks starts Flash Player, which either plays Shockwave animations or runs commands (if the user selects the custom command options). The Align panel (Window > Align menu option) is an example of how Flash panels work in the Fireworks interface.
You can call any part of the Fireworks API by embedding the API commands in the following functions. These functions communicate directly with Macromedia Flash Player, which is distributed with Fireworks 8.
MMExecute(jsToPass)
jsToPass A string of JavaScript for Fireworks to execute.
Nothing.
Declares a set of JavaScript code to pass to the Fireworks API, allowing Flash authors to embed Fireworks API commands in a frame of a Flash movie.
Note: MMExecute supersedes the FWJavascript command. However, the FWJavascript command still works in the current version of Fireworks.
The commands should be embedded in the same way that you would write separate JavaScript code blocks to perform similar operations, and you can concatenate lines of JavaScript code into one MMExecute() function.
The following example concatenates two lines of JavaScript code into one command:
MMExecute("dom=fw.getDocumentDOM();dom.addNewRectanglePrimitive({left:47, top:26, right:102, bottom:87}, 0");
MMEndCommand(endStatus, notifyString)
endStatus A Boolean value: true to commit changes; false otherwise. If it is set to false, any pending changes are discarded. To commit the changes, endStatus must be set to true.
notifyString A string to notify the user of errors. If the value of endStatus is false, this argument holds a string used to notify the user of the error. If endStatus is set to true, notifyString is an empty string.
Nothing.
This function should be called whenever the user clicks the OK or Cancel buttons provided in the Flash content to execute or cancel a command. This function is used only for modal commands, not for Flash panels.
Note: MMEndCommand supersedes the FWEndCommand command. However, FWEndCommand still works in the current version of Fireworks.
Send me an e-mail when comments are added to this page | Comment Report
Current page: http://livedocs.adobe.com/fireworks/8/fwextending/fw_03_21.htm