# Help!Multichannel webcam live streaming to trigger actions

**URL:** <https://forum.kirupa.com/t/help-multichannel-webcam-live-streaming-to-trigger-actions/45364>\
**Category:** flash\
**Created:** [March 13, 2004, 6:07pm UTC](https://forum.kirupa.com/t/help-multichannel-webcam-live-streaming-to-trigger-actions/45364 "2004-03-13T18:07:14Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![emilylam27](https://avatars.discourse-cdn.com/v4/letter/e/94ad74/32.png) [@emilylam27](https://forum.kirupa.com/u/emilylam27)\
**Post date:** [March 13, 2004, 6:07pm UTC](https://forum.kirupa.com/t/help-multichannel-webcam-live-streaming-to-trigger-actions/45364/1 "2004-03-13T18:07:14Z")

</div>

I am currently doing a project on multichannel camera detection  
I have a problem on triggering actions with multichannel webcam streaming.

I have cam1 and cam2. They are both attached to the same computer.  
On stage there are two Embedded videos. One gets live streaming signals from cam1 and another one gets signals from cam2. No problem.

I put my hand in front of cam1 and move. It detects an activity and then go to play clip1. I put my hand in front of cam2 and move. It detects the motion and go to play clip2. Absolutely fine.

BUT when I put my hands in front of cam1 and cam2 at the same time it doesn’t go to clip 3.

Could you solve the problem for me?

Here are my codes that I use  
Code:

//c1\_cam is cam1 and c2\_cam is cam2  
var c1\_cam = Camera.get(0);  
var c2\_cam = Camera.get(1);

System.showSettings(3);

myVideoInstance1\_vid.attachVideo(c1\_cam);  
myVideoInstance2\_vid.attachVideo(c2\_cam);

//detecting motion from cam1  
c1\_cam.setMotionLevel(60,200);  
c1\_cam.setMode(30,30,8);  
c1\_cam.onActivity = function () {gotoAndPlay(“clip1”);  
}  
//detecting motion from cam2  
c2\_cam.setMotionLevel(60,200);  
c2\_cam.setMode(100,100,8);  
c2\_cam.onActivity = function () {gotoAndPlay(“clip2”);  
}

//this is the code for detecting motion from both cam1 and cam2 at the  
// same time, please correct anything that’s wrong.  
var c1c2\_cam = c1\_cam.onActivity && c2\_cam.onActivity  
if (c1c2\_cam) {  
function () {gotoAndPlay(“clip3”);  
}

Please help . Thanks

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 13, 2004, 7:37pm UTC](https://forum.kirupa.com/t/help-multichannel-webcam-live-streaming-to-trigger-actions/45364/2 "2004-03-13T19:37:50Z")

</div>

now i dont know barely any AS but could u set an if then statment to detect if movieclip 1 or 2 is displayed an if not, go to movieclip 3? Just a different approach, i dont even know if its possible.

O and u would have to have another movieclip to show if nothing is detected…

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 13, 2004, 9:19pm UTC](https://forum.kirupa.com/t/help-multichannel-webcam-live-streaming-to-trigger-actions/45364/3 "2004-03-13T21:19:24Z")

</div>

just a shot in the dark but i didnt test anything …i’ll get back to you soon ,right now im busy .but maybe try this //

```auto

var c1_cam, c2_cam = c1_cam.onActivity && c2_cam.onActivity;
if (c1_cam == true) {
	c1_cam.onActivity;
	if (c2_cam == true) {
		c2_cam.onActivity;
		function () {
			gotoAndPlay("clip3");
		};
	}
}

```
