Quick AS3 Webcam Capture Class

If you are feeling lazy and don’t want to look up exactly how to instantiate a webcam and use it to take a snapshot of the user… just download this and use like so. It also flips the image so the user is not completely disoriented.

The default camera size is 600 x 400, you can pass two optional params to the constructor to specify different dimensions.

var webcam:CamGrabber= new CamGrabber();
btnToPress.addEventListener(MouseEvent.CLICK, onPictureSnap, false, 0, true);

function onPictureSnap(e:MouseEvent):void{
      var userpic:Bitmap=new Bitmap(webcam.snap());


2 Responses to “Quick AS3 Webcam Capture Class”

  1. Polprav says:

    Hello from Russia!
    Can I quote a post in your blog with the link to you?

Leave a Reply

Your email address will not be published. Required fields are marked *

This blog is kept spam free by WP-SpamFree.

Get Adobe Flash player