6 Replies Latest reply on Oct 27, 2015 7:55 AM by kglad

    Would it be possible capturing camera on mobile devices (ios and android)?

    WaterCode

      Sir,

      I have no frind and support ,But I have a issue in ios and android ,to need me save the video By

      Adobe Flash Profession.I understand We can design code for Andriod and IOS, and compiling ,packaging

      in Flash Apps, But my issue is Would it be possible (input) capturing camera on mobile devices and ouput a H.264 files.

      I have friend, In this world, Can you Let me know ,I am not alone ,I need to fight for my faith the mobile phone isn't trouble maker....@.

        • 1. Re: Would it be possible capturing camera on mobile devices (ios and android)?
          kglad Adobe Community Professional & MVP

          you can access data in the media library using the cameraroll class.

          • 2. Re: Would it be possible capturing camera on mobile devices (ios and android)?
            WaterCode Level 1

            Sir,(kglad.com):I am sorry...

            I am not an expert, And I lose my job in this morning,

            Could you give me some code suggestions or code hints;

            I just know that I should used ActionScript 3.0 or class has a function inside

            Is it passible save recording file to the Google map? or Apple map? Because I lose my life map again,

            Such accidents should not be happen again.

            • 3. Re: Would it be possible capturing camera on mobile devices (ios and android)?
              WaterCode Level 1

              Something like this code,, and nothing really happens.@@

               

               

              package

              {

                   import flash.display.Bitmap;

                   import flash.display.BitmapData;

                   import flash.display.Loader;

                   import flash.display.Sprite;

                   import flash.display.StageAlign;

                   import flash.display.StageScaleMode;

                   import flash.events.Event;

                   import flash.events.IOErrorEvent;

                   import flash.events.MediaEvent;

                   import flash.media.CameraRoll;

                   import flash.media.MediaPromise;

               

                   public class main extends Sprite

                   {

                        public var imgLoader:Loader;

                        public var cam:CameraRoll;

                        public var promise:MediaPromise;

                        public function main()

                        {

                             // support autoOrients

                             stage.align = StageAlign.TOP_LEFT;

                             stage.scaleMode = StageScaleMode.EXACT_FIT;

                             cam = new CameraRoll();

                             cam.browseForImage();

                             cam.addEventListener(MediaEvent.SELECT,onSelect);

                        }

               

                        public function onSelect(e:MediaEvent):void{

                             promise =  e.data as MediaPromise

                             addToStage();

                        }

               

                        public function addToStage():void {

               

                             imgLoader = new Loader();

                             imgLoader.contentLoaderInfo.addEventListener(Event.COMPLETE,drawBitmap);

                             imgLoader.addEventListener(IOErrorEvent.IO_ERROR, errorHandlerIOErrorEventHandler);

                             imgLoader.loadFilePromise(promise);

               

                        }

               

                        protected function errorHandlerIOErrorEventHandler(event:Event):void

                        {

                             trace("here");

                        }

                        public function drawBitmap(e:Event):void{

                             var myBitmapData:BitmapData = new BitmapData(200,200);

                             var image:Bitmap = new Bitmap(myBitmapData);

                             image.bitmapData = Bitmap(e.currentTarget.content).bitmapData

                             image.width = image.height = 200

                             image.x = image.y = 50

                             addChild(image);

                        }

                   }

              }

              • 5. Re: Would it be possible capturing camera on mobile devices (ios and android)?
                WaterCode Level 1

                Sir ,,

                No, It's I google in keyword "cameraroll class",,

                The truth is ,I have no idea. Just try to work hard at this issue.

                • 6. Re: Would it be possible capturing camera on mobile devices (ios and android)?
                  kglad Adobe Community Professional & MVP

                  if you don't understand the basics of actionscript it's going to be difficult for you to do this.

                   

                  if main is your document class, that code will (try to) compile.