Created
November 19, 2010 16:51
-
-
Save AaronMeyers/706760 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// first find out if the computer has an iSight | |
var camIndex:Number = -1; | |
for (var i:Number=0; i<Camera.names.length; i++) { | |
if (Camera.names[i] == 'Built-in iSight') { | |
camIndex = i; | |
break; | |
} | |
} | |
// if there is an iSight AND a Google Webcam Adapters, we'll want to attach them all | |
if (camIndex > -1) { | |
for (var i:Number=0; i<Camera.names.length; i++) { | |
if (Camera.names[i].substr(0,6) == 'Google') { | |
var camera:Camera = Camera.getCamera(i.toString()); | |
var video:Video = new Video(); | |
video.attachCamera(camera); | |
} | |
} | |
} | |
// Ok, so now go ahead and attach the main webcam | |
var mainCam:Camera = (camIndex>-1) ? Camera.getCamera(camIndex.toString) : Camera.getCamera(); | |
var mainVid:Video = new Video(); | |
mainVid.attachCamera(mainCam); | |
addChild(mainVid); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment