loader.dataFormat = URLLoaderDataFormat.TEXT;
loader.addEventListener(Event.COMPLETE, onLoadXML); //โหลดเรียบร้อยไปใช้ฟังก์ชั่น onLoadXML
loader.load(new URLRequest("XML/testmy.xml"));
function onLoadXML(ev:Event) {
try { var myXML:XML = new XML(ev.target.data);
for (var i=0; i
trace(myXML.dramalist[i].time);
}
} catch (e:TypeError) {
trace("Could not parse the XML");
trace(e.message);
}
}
No comments:
Post a Comment