Cannot load image from applicationStorageDirectory
Hi!
At program startup I load binary data of images from a remote server and save them locally in my applicationStorageDirectory:
imageFile = new File(File.applicationStorageDirectory.nativePath);
imageFile = imageFile.resolvePath("images/" + obj.id + extension);
var filestream:FileStream = new FileStream();
filestream.open(imageFile, FileMode.WRITE);
filestream.writeBytes(loader.data);
filestream.close();
later, when I need the image for display reasons, I try to load them from my applicationStorageDirectory:
file = new File(File.applicationStorageDirectory.nativePath);
file = file.resolvePath("images/" + obj.id + extension);
image.load(new URLRequest(file.nativePath));
I made an output with both urls and they are identical. Nonetheless the image fails to load with error #2035.
In the desktop version of this application I store images in and load them from the applicationDirectory. This works fine!
Can anybody help?
Judith
