1 Reply Latest reply on Jul 29, 2010 2:41 AM by kkc_mca

    Camera Access choice Allow or Deny??

    kkc_mca

      How I can know, whether the user click on Allow or Deny??

       

      What is the event so that i can handle the user choice.

        • 1. Re: Camera Access choice Allow or Deny??
          kkc_mca Level 2

          To get the user choice we need add StatusEvent.STATUS listener to the camera object
          The below example code code 
          
          camera.addEventListener(StatusEvent.STATUS, camera_status);
          private function camera_status(evt:StatusEvent):void {
                          var str:String = "[{0}] code:'{1}', level:'{2}'\\n";
                          textArea.text += StringUtil.substitute(str,
                                              evt.type,
                                              evt.code,
                                              evt.level);
                          switch (evt.code) {
                              case "Camera.Muted":
                                  Alert.show("User denied access to camera.");
                                  break;
                              case "Camera.Unmuted":
                                  Alert.show("User allowed access to camera.");
                                  break;
                          }
                      }