I'm having the same trouble - following
http://www.adobe.com/devnet/flash/articles/webcam_motion_03.html. I have the webcam feed working fine. On one frame I put the code and i have
defined a movieclip with the name snap_btn. It creates the blank bitmap but
won't fill it with the image. I don't think the button works either.
anybody help?
Dom
Code follows:
:frown;
//(From previous page)
/* capture the video stream from the active webcam and display it inside the
video object */
output_vid.attachVideo(Camera.get());
import flash.display.BitmapData;
import flash.geom.Matrix;
/*
create a new bitmap object that is the same size
as the Video object to store the pixel data
*/
var snapshot:BitmapData = new BitmapData(output_vid._width,
output_vid._height);
/*
create a function that takes a snapshot
of the Video object whenever it is called
*/
function takeSnapshot() {
//draw the current state of the Video object into
//the bitmap object with no transformations applied
snapshot.draw(output_vid, new Matrix());
}
//create a movie clip to hold the bitmap when we attach it
this.createEmptyMovieClip("bitmap_mc", this.getNextHighestDepth());
//display the specified bitmap object inside the movie clip
bitmap_mc.attachBitmap(snapshot, 1);
snap_btn.addEventListener("click", mx.utils.Delegate.create(this,
takeSnapshot));