I’m doing the tutorial here : http://www.kirupa.com/developer/flashcs3/using_xml_as3_pg2.htm
And when I type in the code to load in the XML, I get the following error:
1046: Type was not found or was not a compile-time constant: XML.
This is the code:
var xmlLoader:URLLoader = new URLLoader();
var xmlData:XML = new XML();
xmlLoader.addEventListener(Event.COMPLETE, LoadXML);
xmlLoader.load(new URLRequest("http://www.kirupa.com/net/files/sampleXML.xml"));
function LoadXML(e:Event):void {
xmlData = new XML(e.target.data);
trace(xmlData);
}
What am I missing?