2.8. Prompting the User to Change Player Settings
Problem
You want to open the user’s Flash Player Settings dialog box to prompt her to allow greater access to her local system.
Solution
Use the System.showSettings( )
method.
Discussion
The System.showSettings( ) method opens the
Flash Player Settings dialog box, which includes four tabs. The
number in parentheses is the value you pass to
showSettings( ) to open that particular tab.
- Privacy (0)
Allows the user to specify whether to allow Flash access to her camera and microphone.
- Local Storage (1)
Allows the user to specify how local shared objects are stored, including the maximum allowable disk usage.
- Microphone (2)
Allows the user to select a microphone and adjust the volume.
- Camera (3)
Allows the user to select a camera.
If you don’t pass any parameters to the
showSettings( ) method, it opens the Settings
dialog box to the tab that was opened the last time the Settings
dialog box was used. Here, we open the Settings dialog box to the
Local Storage tab by explicitly specifying a value of 1:
// Open theSettingsdialog box to theLocal Storagetab. System.showSettings(1);
Tip
Out of courtesy, you should prompt the user to open the Settings dialog box with a button rather than simply opening it without warning. Also, you should alert the user beforehand as to which settings to change.
See Also
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access