I don't know of a property that tells you this. But there may be a way to
find out with the users help.

If the mic is muted I open an alert window and tell the user that they'll
need to enable it in the settings dialog. If they click OK to the alert
window then I open the Flash microphone settings window and listen for the
mic status change event to know when they've made a choice.

When you hear back from that event (in onMicAccessChange) you can check if
the muted property is still true. If they say yes then the user may have
the global settings selected. You can then inform them that the global
settings might be preventing your app from accessing the mic and then ask
them to check the global settings themselves or open the global settings
page for them. You may want to show another alert asking if the global mute
was enabled and if they click Yes then reload the app).


        /**
         * Shows dialog if microphone is not enabled or available.
         */
        public function enableMicrophone():void {
            microphone = Microphone.getMicrophone();

            // If Microphone.getMicrophone() returns null, either the
microphone is in use by
            // another application, or there are no microphones installed
on the system.
            // To determine whether any microphones are installed, use
Microphones.names.length.
            if (microphone == null) {
                Alert.show("You will need to select a microphone and allow
this application to access it.", "Microphone Required", 4,
FlexGlobals.topLevelApplication as Sprite, selectMicrophoneHandler);
            }

            if (microphone.muted) {
                Alert.show("You will need to allow access to you microphone
to continue. Select Allow.", "Microphone Required", 4,
FlexGlobals.topLevelApplication as Sprite, allowAccessToMicrophoneHandler);
            }

        }


        /**
         *
         * @param event
         */
        public function selectMicrophoneHandler(event:CloseEvent):void {

            // show settings if mic is muted
            if (event.detail == Alert.OK) {
                Security.showSettings(SecurityPanel.MICROPHONE);
                displayedMicrophoneSettings = true;
            }
            else if (event.detail == Alert.CANCEL) {

                if (microphone == null) {
                    Alert.show("If you don't have a microphone or have
selected one from the menu you won't be able to record audio...");
                }
            }

        }


        /**
         *
         * @param event
         */
        public function
allowAccessToMicrophoneHandler(event:CloseEvent):void {

            // show settings if mic is muted
            if (event.detail == Alert.OK) {
                Security.showSettings(SecurityPanel.PRIVACY);
                displayedPrivacySettings = true;
            }

            // user canceled selection
            else if (event.detail == Alert.CANCEL) {

                // user chose to not allow microphone access
                // may need to reload the app to pop up the security dialog
again
                if (microphone.muted) {
                    Alert.show("If you don't enable your microphone you
won't be able to record anything...");
                }
            }


            // set mic name and mute status
            if (microphone &&
!microphone.hasEventListener(StatusEvent.STATUS)) {
                microphone.addEventListener(StatusEvent.STATUS,
onMicAccessChange);
            }

        }


        /**
         *
         * @param event
         */
        public function onMicAccessChange(event:StatusEvent):void {
            statusCode = event.code;
            statusMessageLevel = event.level;
            // check for microphone is still muted here
        }


On Tue, Jun 19, 2012 at 12:23 PM, Chuck Preston <itsmechuc...@yahoo.com>wrote:

> **
>
>
> Is there a way to check if the user has selected "block all sites from
> using the camera and microphone" in the global Flash settings with AS3?
>
> I'm trying to access the microphone and if the user has "block all
> sites..." selected, I need to put up a dialog box. Microphone.muted is true
> if the user has "block all sites..." selected or not.
>
>  
>

Reply via email to