 import com.freshplanet.ane.AirImagePicker.AirImagePicker;
 import com.freshplanet.ane.AirImagePicker.AirImagePickerImageData;
 import com.freshplanet.ane.AirImagePicker.events.AirImagePickerDataEvent;
+import com.freshplanet.ane.AirImagePicker.events.AirImagePickerErrorEvent;
 import com.freshplanet.ane.AirImagePicker.events.AirImagePickerRecentImagesEvent;
 
 import flash.display.Bitmap;


	    AirImagePicker.instance.addEventListener(AirImagePickerDataEvent.CANCELLED, onImagePickCanceled);
	    AirImagePicker.instance.addEventListener(AirImagePickerDataEvent.IMAGE_CHOSEN, onImageChosen);
	    AirImagePicker.instance.addEventListener(AirImagePickerDataEvent.CAMERA_PERMISSION_ERROR, onCameraPermissionError);
	    AirImagePicker.instance.addEventListener(AirImagePickerDataEvent.GALLERY_PERMISSION_ERROR, onGalleryPermissionError);
	    AirImagePicker.instance.addEventListener(AirImagePickerRecentImagesEvent.ON_LOAD_RESULT, onRecentImagesResult);
	    AirImagePicker.instance.addEventListener(AirImagePickerRecentImagesEvent.PERMISSION_ERROR, onRecentImagesPermissionError);


        }
    }

	private function onError(event:AirImagePickerErrorEvent):void {
		trace("Error occurred: ", event.error);
	}

	private function onImagePickCanceled(event:AirImagePickerDataEvent):void {
		trace("Image pick cancelled");
	}
