1 Reply Latest reply on Oct 11, 2013 8:02 PM by GeorgeMcKinney

    [Flex Mobile] take photo without lauching Camera application.

    havefreetime Level 1

      Hi there.


      Is it possible to take photo without lauching Camera app?


      Following source code must select PhotoApp when I click the button.  I wanna take a photo only using my app.


      I've searched enough in Google. Please give me a hint.


      Thanks in advanced.





      <?xml version="1.0" encoding="utf-8"?>

      <s:View xmlns:fx="http://ns.adobe.com/mxml/2009"

                 xmlns:s="library://ns.adobe.com/flex/spark" title="HomeView"




                      import mx.events.FlexEvent;


                      private var camera:CameraUI;

                      private var file:File;



                      protected function view1_creationCompleteHandler(event:FlexEvent):void


                           // TODO Auto-generated method stub



                                 camera = new CameraUI();

                                 camera.addEventListener(MediaEvent.COMPLETE, onComplete);

                                 camera.addEventListener(ErrorEvent.ERROR, onError);




                      private function onError(event:ErrorEvent):void





                      private function onComplete(event:MediaEvent):void


                           var mediaPromise:MediaPromise = event.data;        



                      private function captureImg(event:MouseEvent):void










           <s:Panel title="TakePhoto" width="90%" height="90%" top="5">

                 <s:Button label="TakePhoto" click="captureImg()" />