Loading and using XML data in AS3 - Step two: Loading the XML file
Posted by : FireCode on Jun 10, 2010
var _loader:URLLoader = new URLLoader();
var _request:URLRequest = new URLRequest("example.xml");
var _xml:XML = null;
_loader.load(_request);
_loader.addEventListener(Event.COMPLETE, Complete, false, 0, true);
function COMPLETE(e:Event):void
{
_xml= new XML(e.target.data);
}
The URLLoader Class is the class responsible for loading all binary and textual data. The URLLoader Class needs the URL to be passed to it as an instance of the URLRequest Class. And finally we have a variable to hold an instance of the XML Class.
When the XML file finishes loading the function Complete will be triggered.

no comment
Add comment