Created
September 8, 2016 06:34
-
-
Save marchbold/77cfcd984dd4d6df1f786f3850ee1905 to your computer and use it in GitHub Desktop.
Capture an Image using the CameraUI
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CameraUI.service.addEventListener( CameraUIEvent.COMPLETE, cameraUI_completeHandler ); | |
CameraUI.service.addEventListener( CameraUIEvent.CANCEL, cameraUI_cancelHandler ); | |
CameraUI.service.launch( MediaType.IMAGE ); | |
... | |
private function cameraUI_completeHandler( event:CameraUIEvent ):void | |
{ | |
// Here you can use the event.path to access the media file as you require | |
// Display the captured image | |
var l:Loader = new Loader(); | |
l.load( new URLRequest( event.path )); | |
addChild( l ); | |
} | |
private function cameraUI_cancelHandler( event:CameraUIEvent ):void | |
{ | |
trace( "user cancel" ); | |
} | |
// com.distriqt.CameraUI |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment