
294
EXTENDING FIREWORKS
Cross-Product Extensions
Las
t
up
d
a
ted
12/8/2009
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 Adobe 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 Adobe 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.
To install the API wrapper, make sure you have the Adobe Extension Manager installed and double-click the
Extension file. In Adobe Flash, the wrapper appears in the Components window as FWCommandComponents.
The following example shows a command without the wrapper:
var path = MMExecute("fw.appPatternsDir;");
The following example shows the same command using the wrapper:
var path =fwapi.getAppPatternsDir();
Working with ActionScript files
You can simplify the editing task by keeping a separate ActionScript file for ActionScript; in this way, you don’t need
to open and edit the FLA file directly. Your FLA file must have a
#include
myStringFile
.as
statement in the first
frame (where
myStringFile
is the name of your ActionScript file) to ensure that the ActionScript strings are complied
at publishing time.
Note:
The FLA and ActionScript files should reside in the same folder so that the ActionScript file can be easily found for
compiling.
Guidelines for creating panels and commands
•
You need to surround nested quotation marks need with backslash (\). The following example prints:
John's
example is really "complex"!
MMExecute('alert("John\'s example is really \"complex\"!")';
•
The movie size set in Flash is used in Fireworks as the minimum and default size of the command panel.
Содержание 65011817 - Fireworks CS4 - Mac
Страница 1: ...Extending ADOBE FIREWORKS CS4...