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"); }
0 comments:
Post a Comment