Hello,
I am having trouble loaded images into my air app. The folder containing the images (.png) is included in the "Included Files" section in the AIR for Android publish settings. Once the app is installed on the device (i am using a Droid X with Android 2.2), where are would these files be located? Is there some way to specify where exactly they will go? I have tried the 2 options below for loading the images and both fail (they both work when testing the movie on my dev machine).
1. imageFile.exists returns false:
var imageFile:File = File.applicationDirectory.resolvePath("Images/test.png");
if (imageFile.exists) {
imageLoader = new Loader();
imageLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, onTestImageLoaded, false, 0, true);
imageLoader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler, false, 0, true);
imageLoader.load(new URLRequest(imageFile.url));
}
2. Event.COMPLETE never fires in this scenario:
imageLoader = new Loader();
imageLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, onTestImageLoaded, false, 0, true);
imageLoader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);
imageLoader.load(new URLRequest("Images/test.png"));
I'm guessing the path to my image is incorrect as far as Android is concerned in my URLRequest param...
Any help would be greatly appreciated!