What is the process for feeding XMLList values to a URLRequest method?
Say I have an array:
code:
var imageURLS:Array = ["images/image1.png", "images/image2.png", "images/image3.png"];
Then I feed a loader instance:
code:
var loader:Loader = new Loader();
loader.load(new URLRequest(imageURLS[0])); // imageURLS[0] traces 'string'
addChild(loader);
// works great, no problem...
...now say I want to bring these images in via XML rather than an array:
code:
var xmlData:XMLManager = new XMLManager("images.xml");
xmlData.addEventListener(Event.COMPLETE, loadXML);
xmlData.start();
var pathList:XMLList = new XMLList();
function loadXML(event:Event):void {
pathList = xmlData.xmlContent.image.path.text();
firstPath = pathList[0].toString();
}
trace(firstPath); // traces 'images/image1.png'
trace(typeof(firstPath)); // traces 'string'
trace(imageURLS[0]); // traces 'images/image1.png'
trace(typeof(imageURLS[0])); // traces 'string'
var loader:Loader = new Loader();
loader.load(new URLRequest(firstPath));
addChild(loader);
// OUTPUT: 'Error #2044: Unhandled IOErrorEvent:. text=Error #2035: URL Not Found'
Way I see it is the traces above are the same, where am I wrong?