flash8 webcam motion detection

Hi all,

I’m currently trying to use flash8 and my webcam to do something similar to
http://www.setpixel.com/content/?ID=fire

I’ve just started playing with camera scripts and therefore am stuck with quite alot of problems. But i decided to go on step by step.
First problem i met,
I am unable to display the snapshot of my webcam into a movieclip…
As in i want to take a frame of my webcam input and draw it into a movieclip… (so i can compare with later frames to see if there is any motion.)
Anyone can help me out here? What is wrong with my script?
It’s just supposed to take the webcam image on every enterframe and input it to my movieclip right beside my live input of my webcam… But it appears as a blank MC…


webCam.attachVideo(Camera.get());

import flash.display.BitmapData;
import flash.geom.Matrix;

var snapshot:BitmapData = new BitmapData(webCam._width,webCam._height);
snapshot.draw(webCam,new Matrix());

this.createEmptyMovieClip(“cloneVid”,this.getNextHighestDepth());
cloneVid._x = (webCam._width)+20
cloneVid._y = webCam._y

function takeSnapshot(){
snapshot.draw(webCam,new Matrix());
cloneVid.attachBitmap(snapshot,this.getNextHighest Depth())
}

onEnterFrame = function () {
takeSnapShot()
}


Also, if any of you had managed to do the fire thingy out, any possibilty that you could post the fla up for study?
Many thanks in advance guys~