Recipe 3.11.
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 flash.system.Security.showSettings(
) method.
Discussion
The flash.system.Security.showSettings( )
method opens the Flash Player Settings dialog box, which includes
several tabs. You'll pass a string as a parameter to indicate which
tab you want it to open. These strings have been made static
properties of the flash.system.SecurityPanel class, to avoid
typographical errors. The possible values are:
SecurityPanel.CAMERA
-
Allows the user to select a camera to use.
SecurityPanel.DEFAULT
-
Shows whichever tab was opened the last time the
Security Panel was open.
SecurityPanel.LOCAL_STORAGE
-
Allows the user to specify how local shared
objects are stored, including the maximum allowable disk usage.
SecurityPanel.MICROPHONE
-
Allows the user to select a microphone and
adjust the volume.
SecurityPanel.PRIVACY
-
Allows the user to specify whether to allow
Flash access to her camera and microphone.
SecurityPanel.SETTINGS_MANAGER
-
Opens a new browser window and loads the
Settings Manager page, which gives the user several more detailed
options and the ability to make global changes, rather than just to
the domain of the specific movie that is active.
If you don't pass any parameters to the
showSettings( )
method, it uses SecurityPanel.DEFAULT. Here, we open the
Settings dialog box to the Local Storage tab by explicitly
specifying a value of 1.
// Open the Settings dialog box to the Local Storage tab.
flash.system.Security.showSettings(SecurityPanel.LOCAL_STORAGE);
|
Out of courtesy, you should prompt the user to
open the Settings dialog with a button rather than simply opening
it without warning. Also, you should alert the user beforehand as
to which settings she should change.
|
|
|