Displaying a webcam’s video in a Flex VideoDisplay control – attachCamera(), getCamera()
Posted on September 18, 2010 | No Comments
The following example shows you how you can display a user’s webcam feed in a VideoDisplay control using the static Camera.getCamera() method and VideoDisplay class’s attachCamera() method.
[/as3]
< ?xml version="1.0" encoding="utf-8"?>
< ![CDATA[
import mx.controls.Alert;
private function videoDisplay_creationComplete():void {
var camera:Camera = Camera.getCamera();
if (camera) {
videoDisplay.attachCamera(camera);
} else {
Alert.show("You don't seem to have a camera.");
}
}
]]>
[/as3]
Comments
Leave a Reply
You must be logged in to post a comment.