Help!Multichannel webcam live streaming to trigger actions

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

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…

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 //


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");
		};
	}
}