Skip to main content
Inspiring
Mar 20, 2012 4:49 PM UTC
Question

iPhone Front Facing Camera

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

This topic is closed to new replies. Start a new post to keep the conversation going.

5 replies

Inspiring
Mar 21, 2012 9:08 PM UTC

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();

        }

Translate
Jul 24, 2012 6:34 PM UTC

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?

Translate
Nimisha1
Participating Frequently
Jul 26, 2012 6:45 AM UTC

Please check following:

Is your swf-version is correctly set to 15 ?

Have you imported the class flash.media.CameraPosition ?

Translate
Known Participant
Mar 20, 2012 7:08 PM UTC

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

Here have a sample.

Good luck

Bruno Brustoloni e Oliveira

Translate
Applauz78Author
Inspiring
Mar 21, 2012 12:55 AM UTC

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.

Translate