function loadXML()
{
var book_xml:XML;
var urlLoader:URLLoader=new URLLoader();
var urlRequest:URLRequest=new URLRequest("stories.xml");
urlLoader.addEventListener(Event.COMPLETE, completeLoading);
urlLoader.load(urlRequest);
var holder = "";
function completeLoading(event:Event):void {
//when loading of XML completed, the data can
//go into the internal variable of type XML
book_xml=new XML(urlLoader.data);
//display the XML object book_xml as a text
//inside text area myxml_ta
holder = book_xml.toString();
// if i were to do the trace here it would output properly
}
// tracing here doesnt output the string
trace(holder);
}
Bookmarks