header
ask question
Click here to ask Question Now Its free No registration required. Flash, Flex, Flash Media Server, ActionScript,Adobe Air. Most questions receive a response in an hour.
Amina
Points:260
Posts:11
Answered

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



Fedrick
Points: 0
Posts:0
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;

Lexus
Points: 0
Posts:0
Accepted Answer
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

Amina
Points: 260
Posts:11
2/17/2010 2:41:00 AM



Ok
great :D


Post your Reply
Name  

Email

Type your Reply or Answer

Are you human? What is 1+1 



Members Login

Email  
Password
Forgot Password





This website focus on: Flash | Flex | FMS | RED5 | WOWZA | Flash Media Server | Adobe AIR | ActionScript,Flash Solutions | Flash Question | Flash Answers | Flash Developers | Flash Problem, Flash Help, Flash bugs, Flash workaround | Flash Blog | Flex Question Answers | Flash Forum | Flex Development | Actionscript development | Flash development | Adobe AIR development
Copyright © 2008 AskMeFlash.com. All rights reserved. Privacy Policy | Terms & Conditions