User Guide

Flash panels 91
Description
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.
Example
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()
Usage
MMEndCommand(endStatus, notifyString)
Arguments
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.
Returns
Nothing.
Description
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.
Using the API wrapper extension in Macromedia Flash
You can install a special extension that was developed specifically for writing Fireworks functions
in ActionScript (currently, only ActionScript 1.0) either as a replacement for the
MMExecute()
and
MMEndCommand() functions or to be used in conjunction with them. After it is installed, the
API wrapper appears in the Macromedia Flash interface. This wrapper simplifies the writing of
Fireworks commands. Instead of having to embed every Fireworks function in
MMExecute(), you
can use a series of
fwapi functions in the ActionScript. Then, when it is published, the wrapper
translates the
fwapi functions into the expanded Fireworks functions. You can also mix the fwapi
functions with MMExecute() statements.