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

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:

Example

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{
            // got a valid response!
            alert("Nice to meet you, " + response);
            window.close();
         }
            doneFlag = true;
      }
   }
}

 

Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/dreamweaver/8/apiref/05_fwin6.htm