# Help!Multichannel webcam live streaming to trigger actions

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