254
Chapter 5: Fireworks JavaScript API
Example
The Macromedia Flash writer is controlled by the values of several preferences. See the following
example for allowed values. A well-behaved script should restore the original values after
exporting the file.
var prevMaintainObjEditable = fw.getPref("SwfMaintainObjEditable");
fw.setPref("SwfMaintainObjEditable", true);
// maintain non-text editability
//at expense of appearance or not
var prevMaintainTextEditable = fw.getPref("SwfMaintainTextEditable");
fw.setPref("SwfMaintainTextEditable", false);
// maintain text editability
// at expense of appearance or not
var prevExportAllFrames = fw.getPref("SwfExportAllFrames");
fw.setPref("SwfExportAllFrames", true);
// if true all frames are exported
var prevExportFromFrame = fw.getPref("SwfExportFromFrame");
fw.setPref("SwfExportFromFrame", 1);
// from frame; only used ifSwfExportAllFrames is false
var prevExportToFrame = fw.getPref("SwfExportToFrame");
fw.setPref("SwfExportToFrame", 5);
// from frame; only used if SwfExportAllFrames is false
var prevJpegQualit = fw.getPref("SwfJpegQuality");
fw.setPref("SwfJpegQuality", 85); // JPEG quality
var prevFrameRate = fw.getPref("SwfFrameRate");
fw.setPref("SwfFrameRate", 5); // frame rate
fw.exportSWF(null, "file:///C|/new folder/test.swf");
// Put the prefs back.
fw.setPref("SwfMaintainObjEditable", prevMaintainObjEditable);
fw.setPref("SwfMaintainTextEditable", prevMaintainTextEditable);
fw.setPref("SwfExportAllFrames", prevExportAllFrames);
fw.setPref("SwfExportFromFrame", prevExportFromFrame);
fw.setPref("SwfExportToFrame", prevExportToFrame);
fw.setPref("SwfJpegQuality", prevJpegQualit);
fw.setPref("SwfFrameRate", prevFrameRate);
fw.findApp()
Availability
Fireworks MX.
Usage
fw.findApp(
macAppSignature or winExeRegistryName
)
Arguments
macAppSignature
A Macintosh-specific string that identifies the signature of the application to
find, such as "
MKBY
".
winExeRegistryName
A Windows-specific string that identifies the name of an executable to
find in the Windows registry, such as "
Fireworks.exe
".
Returns
A URL to the application. This URL can be passed as an argument to
fw.launchApp()
. If no
such application can be found, the URL is empty.
Summary of Contents for DREAMWEAVER MX 2004-EXTENDING DREAMWEAVER
Page 1: ...Extending Fireworks...
Page 4: ...4 Contents...
Page 8: ...8 Chapter 1 Extending Fireworks Overview...
Page 102: ...102 Chapter 4 Auto Shapes...