Skip to main content
Inspiring
March 20, 2012
Question

iPhone Front Facing Camera

  • March 20, 2012
  • 2 replies
  • 1846 views

Does anyone have an example of accessing the front camera on an iPhone ?

This topic has been closed for replies.

2 replies

Inspiring
March 21, 2012

I literally just setup this up for the first time today and can confirm it works on ipad and iphone....

this._camera = this.getCamera(CameraPosition.FRONT);


        private function getCamera($position:String):Camera{

            for (var i:uint = 0; i < Camera.names.length; ++i)

            {

                var cam:Camera = Camera.getCamera(String(i));

                if (cam.position == $position) return cam;

            }

            return Camera.getCamera();

        }

July 24, 2012

Hi,

im trying to implement this in Flash CS6 exporting as Air for Android 3.2/Actionscript 3.

Im getting a compile error:


1120: Access of undefined property CameraPosition

What am i missing here?

Any ideas?

Nimisha1
Participating Frequently
July 26, 2012

Please check following:

Is your swf-version is correctly set to 15 ?

Have you imported the class flash.media.CameraPosition ?

Known Participant
March 20, 2012

http://www.adobe.com/devnet/air/articles/uploading-images-media-promise.html

Here have a sample.

Good luck

Bruno Brustoloni e Oliveira

Applauz78Author
Inspiring
March 21, 2012

Hi.. 

Thanks for this..   I'm already able to capture the photo ... the problem is that I cant get it to default as the front facing camera when the camera ui opens up.