Initializing Camera (AS3)

This is how you get the camera using ActionScript 3.0, very useful for your Webcam/FMS related projects

[code]
package {

import flash.media.Camera;
import flash.media.Video;

public class createCamera extends Video {

private var camera:Camera;
private var camQ:int = 0;
private var FPS:int = 30;

public function createCamera (w:Number = 320, h:Number = 240)
{
this.width = w;
this.height = h;
startCamera();
}

public function startCamera():void
{
camera = Camera.getCamera();
camera.setQuality(0, camQ);
camera.setMode(this.width, this.height, FPS);
this.attachCamera(camera);
}
}
}
[/code]

Initializing Camera (AS3)