How to preview image using xml gallery in android?-Collection of common programming errors
I try to make a simple XML gallery in android platform, but I get an error that says:
Error #2044: Unhandled IOErrorEvent:. text=Error #2035: URL Not Found.
I’m sure that the file location is in the right place /mnt/sdcard/SketchCraft/MyDrawing 1.png
.
This is my XML:
/mnt/sdcard/SketchCraft/MyDrawing 1.png
This is my actionscript:
import flash.net.URLLoader;
import flash.events.Event;
import flash.display.Loader;
import flash.net.URLRequest;
var xmlRequest:URLRequest = new URLRequest("XMLcth.xml");
var xmlLoader:URLLoader = new URLLoader(xmlRequest);
var imgData:XML;
var imageLoader:Loader;
var rawImage:String;
var imgNum:Number = 0;
xmlLoader.addEventListener(Event.COMPLETE, xmlLoaded);
function xmlLoaded(event:Event):void{
imgData= new XML(event.target.data);
rawImage = imgData.image[imgNum].imgURL;
imageLoader =new Loader();
imageLoader.load(new URLRequest(rawImage));
mc_image.addChild(imageLoader);
}