In case Flash no longer exists; a copy of this site is included in the Flashpoint archive's "ultimate" collection.

Dead Code Preservation :: Archived AS3 works from wonderfl.net

webcam

Get Adobe Flash player
by llcheesell 17 Dec 2008
package {

import flash.display.Sprite;
import flash.display.Bitmap;
import flash.display.BitmapData;
import flash.events.*;
import flash.media.Camera;
import flash.media.Video;

public class CameraView extends Sprite {

private var video:Video;
private var cameraBmp:Bitmap;
private var cameraBmpData:BitmapData;

public function CameraView() {

var camera:Camera = Camera.getCamera();

if (camera != null) {
    video = new Video(320,240);
    video.attachCamera(camera);
    addChild(video);
} else {
    trace("error");
}

cameraBmpData = new BitmapData(320,240,false,0xaaaaaa);
cameraBmp = new Bitmap(cameraBmpData);
cameraBmp.x = 320;
addChild(cameraBmp);
}

}
}