I tweet, Follow me

Mac camera with Flash

(personal tip) If we are creating an ActionScript routine to capture an image of our iMac Camera we have to write the next code for Flas CS4 can detect it:

const IMAC_CAMERA:String = "USB Video Class Video";
var AdobeVersion = Capabilities.manufacturer;
var cam:Camera;
var idCam:*;
var realCam= null;

if(AdobeVersion == "Adobe Macintosh"){
    for (idCam in Camera.names){
         if (Camera.names[idCam] == IMAC_CAMERA){
            realCam = idCam.toString();
            break;
          }
    }
    cam = Camera.getCamera(realCam);
}else{
    cam = Camera.getCamera();
}
var vid:Video = new Video();
vid.attachCamera(cam);

Related topics

{ tip, apple, adobe }

About the author

josue

Josue is a Web developer working on Astrata with good friends, he love the music and the science, learn always is funny.

Comments