Amina
Points:260
Posts:11
2/16/2010 1:25:52 AM
Title:
Using multiple cameras in the same application
hello everybody!
I would like to have your help on how to use several webcam within the same application Flex Builder 3
Version French:
salut tous le monde!
je souhaite avoir votre aide sur comment utiliser plusieurs webcam au sein d'une même application Flex Builder 3
2/16/2010 2:19:34 AM
You can get the list of all attached webcams in flash in an array like this
var arrCam:Array = Camera.names;
2/16/2010 2:36:17 AM
Below code you can use to display video from your webcam in Flash Builder/ Flex.
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" minWidth="1024" minHeight="768" applicationComplete="attachvideo()">
<mx:Script>
<![CDATA[
var askCam = Camera.getCamera();
private function attachvideo():void{
var askVid:Video = new Video(askCam.width, askCam.height);
askVid.x = 10;
askVid.y = 10;
askVid.attachCamera(askCam);
rawChildren.addChild(askVid);
}
]]>
</mx:Script>
</mx:Application>
To display multiple cams you just need to add more video components and attach the camera like this :
Instead of using "var askCam = Camera.getCamera();" which gives you default camera.You get array of cameras and use it like this
Suppose you have 3 cams
Ask Question Now Its free No registration required. Flash, Flex, Flash Media Server, ActionScript,Adobe Air. Most questions receive a response in an hour.
var askCam1 = Camera.getCamera(arrayOfCams[0]);
var askCam1 = Camera.getCamera(arrayOfCams[1]);
var askCam1 = Camera.getCamera(arrayOfCams[2]);
Amina
Points: 260
Posts:11
2/16/2010 2:46:26 AM
hi
thank you so mutch for the reply :D
Ok I'll be back after my test
In french:
Salut
Merci beaucoup pour les réponses
d'accord je reviens après mes testes