Access Camera with Actionscript in Android and Iphone

This is a simple example to Access Camera with Actionscript In Android and I phone.

First we need to set the proper permission for our application for access Camera(android only).
Specify Android specific tags to AndroidManifest.xml
<uses-permission name="android.permission.CAMERA">

private var camera:CameraUI;
protected function application1_applicationCompleteHandler(event:FlexEvent):void {
if (CameraUI.isSupported){
camera = new CameraUI();
camera.addEventListener(MediaEvent.COMPLETE, onComplete);
camera.addEventListener(ErrorEvent.ERROR, onError);
status.text="CameraUI supported";
} else {
status.text="CameraUI NOT supported";
}
}
private function captureImage(event:MouseEvent):void {
camera.launch(MediaType.IMAGE);
}
private function onError(event:ErrorEvent):void {
trace("error has occurred");
}


PHP developer Cochin |PHP developer Kerala | PHP developer India | Flash developer/programmer Cochin | Flash developer/programmer Kerala | Flash developer/programmer India | web programmer kerala |web programmer Cochin |web programmer India |web developer kerala |Web developer Cochin | Kerala PHP | PHP freelancer| flash actionscript freelancer