The following example shows how you can use JSFL to close all open documents in the Flash Authoring IDE using the fl.closeAll() command.

Full code after the jump.

// JSFL
fl.closeAll();

Note: the closeAll() method takes an optional parameter, promptToSave, which specifies whether the files should be closed immediately (false), or whether the user will be prompted to save any new or changed files (true). The default value is true.

To close the files immediately, without prompting the user to save changed files, you could use the following code:

// JSFL
fl.closeAll(false);

You can also use the confirm() method to ask the user whether or not all files should be closed immediately, or if they want to have the option of saving any modified files:

// JSFL
var result = confirm("Do you want to save any files or whatever?");
fl.closeAll(result);
Tagged with:
 

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="" highlight="">

Spam Protection by WP-SpamFree