0 Replies Latest reply on Sep 23, 2014 8:53 AM by drmaltby2

    I have a mobile app that crashes when I call camera roll or camera. Is there a bug in Air 15.0.0.252?

    drmaltby2

      I have some code that I created a couple of years ago and it worked fine but when I use the exact same code with Apache Flex 4.13 and Air 15.0.0.252 when tghe camera roll or camera is invoked the app crashes.

       

      protected function uploadCamera_clickHandler(event:MouseEvent):void

      {

          if (CameraUI.isSupported)

          {

              trace("camera is supported");

              var myCam:CameraUI = new CameraUI();

              myCam.launch(MediaType.IMAGE);

              myCam.addEventListener(MediaEvent.COMPLETE, selectCompleteHandler);

          }

          else

          {

              trace("camera not supported");

              AlertBox.show("Error","Camera not supported on this device.");

          }

      }

       

      //select a picture from the camera roll (gallery)

      protected function uploadGallery_clickHandler(event:MouseEvent):void

      {

          if (CameraRoll.supportsBrowseForImage)

          {

              trace("camera roll is supported");

              var roll:CameraRoll = new CameraRoll();

              roll.browseForImage();

              roll.addEventListener(MediaEvent.SELECT, selectCompleteHandler);

          }

          else

          {

              trace("camera roll not supported");

              AlertBox.show("Error", "Camera roll not supported on this device.");

          }

      }

      //when the selection is complete upload it

      protected function selectCompleteHandler(event:MediaEvent):void

      {

          trace("event.data.file.url = "+event.data.file.url);

          //statusText.text = "Uploading...";

          takePhotoButton.enabled = galleryPhotoButton.enabled = false;

          var file:String = event.data.file.url;

          var str:String = StringReplaceAll(file, "file://", "");

          str = StringReplaceAll(str, "/", "//");

          trace(str);

          photoURL = str;

          runtimeimg.source = photoURL;

      }

       

       

      Anyone know why this is happening??

       

      Thanks in advance!