我想通过下面的代码获取通过CameraRoll加载的图像的文件路径。 该应用程序在iOS 8的iPhone上运行,并使用Adobe Air 15进行构建。
var loaderCameraRoll:Loader
var deviceCameraRoll:CameraRoll
function loadImageFromCameraRoll(e:Event=null):void {
deviceCameraRoll = new CameraRoll();
deviceCameraRoll.addEventListener(MediaEvent.SELECT, onSelectCameraRoll);
deviceCameraRoll.browseForImage();
}
function onSelectCameraRoll(event:MediaEvent):void {
var promise:MediaPromise = event.data as MediaPromise;
loaderCameraRoll = new Loader()
loaderCameraRoll.contentLoaderInfo.addEventListener(Event.COMPLETE, onLoadedCameraRoll);
loaderCameraRoll.loadFilePromise(promise);
}
function onLoadedCameraRoll(event:Event):void {
trace("Loaded - File path: ?")
}