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);
{ 0 comments… add one now }