In a previous example, “Displaying messages in Flash using JSFL”, we saw how to display a simple text message to a user using JSFL and the alert() method.
The following example shows how you can display a simple yes/no dialog box (or more accurately an OK/Cancel dialog box) using the confirm() method.
Full code after the jump.
// JSFL confirm("Are you sure you want to delete the Internet?");

The previous example displays a simple OK/Cancel dialog box, but ideally you’d want to capture the user’s response and use it in your JSFL code. The following example shows how you can ask the user whether they want to save any open/modified Flash documents before closing them:
// JSFL var result = confirm("Do you want to save any files or whatever?"); fl.closeAll(result);
If the user clicks the “OK” button, the result variable will contain a value of true. Conversely, if the user clicked the Cancel button, the result variable will contain a value of false.
{ 0 comments… add one now }