webcam
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);
}
}
}