1
votes

I'm using Adobe Air 2.5 and would like to switch between the front and back camera on an Android device. Is there a solution available?

Thanks. Uli

2

2 Answers

2
votes

It was first in 3.0 Adobe added support for front-faced cameras.

For that you can use this:

    var camArr:Array = [];
    function getCameras():void
    {
      for (var i:uint = 0; i < Camera.names.length; ++i)
      {
        var cam:Camera = Camera.getCamera(String(i));
        camArr.push(cam);
      }
    }
1
votes

On Flex 4.5 I found that for iOS you have to use the getCamera("0") or getCamera("1") or simply getCamera(). Using camera names didn't work. Don't know if this was fixed later on.

If you are using android, make sure you enable the camera permissions in your -app.xml file.