(AS3) Webcam motion detection activates a gotoAndPlay action

I’m trying to play around with a flash scene which would only progress from area to area if there is any motion being detected by the webcam. I would really appreciate it if anyone could point me in the right direction. I’ve been trying to find an answer online but I can’t seem to word this correctly.

Thanks in advance,
Gianfranco