![MACROMEDIA DREAMWEAVER MX 2004-DREAMWEAVER API Reference Download Page 65](http://html1.mh-extra.com/html/macromedia/dreamweaver-mx-2004-dreamweaver-api/dreamweaver-mx-2004-dreamweaver-api_reference_3336554065.webp)
The FWLaunch API
65
FWLaunch.getJsResponse()
Availability
Dreamweaver 3, Fireworks 3.
Description
This function determines whether Fireworks is still executing the JavaScript passed to it by the
FWLaunch.execJsInFireworks()
function, whether the script completed successfully, or
whether an error occurred.
Arguments
progressTrackerCookie
•
The
progressTrackerCookie
argument is the cookie object that the
FWLaunch.execJsInFireworks()
function returns.
Returns
A string that contains the result of the script passed to the
FWLaunch.execJsInFireworks()
function if the operation completes successfully, a
null
value if Fireworks is still executing the
JavaScript, or a nonzero error code that indicates one of the following errors occurred:
•
Invalid usage, which indicates that a JavaScript error occurred while Fireworks executed
the script.
•
File I/O error, which indicates that Fireworks cannot create a Response file because the
disk is full.
•
Error notifying Dreamweaver that the user is not running a valid version of Dreamweaver
(version 3 or later).
•
Error starting Fireworks process, which indicates that the function does not open a valid
version of Fireworks (version 3 or later).
•
User cancelled the operation.
Returns
The following code passes the string
"prompt('Please enter your name:')"
to
FWLaunch.execJsInFireworks()
and checks for the result:
var progressCookie = FWLaunch.execJsInFireworks("prompt('Please enter your
name:')");
var doneFlag = false;
while (!doneFlag){
// check for completion every 1/2 second
setTimeout('checkForCompletion()',500);
}
function checkForCompletion(){
if (progressCookie != null) {
var response = FWLaunch.getJsResponse(progressCookie);
if (response != null) {
if (typeof(response) == "number") {
// error or user-cancel, time to close the window
// and let the user know we got an error
window.close();
alert("An error occurred.");
}else{
000_DW_API_Print.book Page 65 Wednesday, August 20, 2003 9:14 AM
Summary of Contents for DREAMWEAVER MX 2004-DREAMWEAVER API
Page 1: ...Dreamweaver API Reference...
Page 24: ...24 Contents...
Page 32: ......
Page 70: ...70 Chapter 5 Fireworks Integration...
Page 76: ...76 Chapter 6 Flash Integration...
Page 116: ...116 Chapter 9 The JavaBeans API...
Page 140: ......
Page 152: ...152 Chapter 11 Application...
Page 218: ...218 Chapter 12 Workspace...
Page 248: ...248 Chapter 13 Site...
Page 292: ...292 Chapter 14 Document...
Page 378: ...378 Chapter 17 Design...
Page 430: ...430 Chapter 18 Code...
Page 486: ...486 Index...