var xml:XML;
var urlL:URLLoader = new URLLoader();
var xmlArray:Array = new Array();
var i:uint;
urlL.dataFormat = URLLoaderDataFormat.TEXT;
urlL.addEventListener(Event.COMPLETE, onLoadedAction);
urlL.load(new URLRequest("list.xml"));
function onLoadedAction(e:Event):void {
try {
xml = new XML(e.target.data);
xml.ignoreWhitespace = true;
for (i = 0; i<xml.video.length(); i++) {
xmlArray.push(xml.video.path[i]);
//trace(xmlArray[i]);
}
} catch (e:Error) {
trace(e.message);
}
}
trace(xmlArray[0]);
This is my code. When I am tracing the 0 th index value from the array, I am getting "undefined" in the output panel.
What is the bug?