Atrix78
May 26th, 2008, 08:48 PM
Hello, I'm trying to do the XML in AS 3.0 on this site, but the code doesn't work properly.
This code gives an error every time.
var xmlLoader:URLLoader = new URLLoader();
var xmlData:XML = new XML();
xmlLoader.addEventListener(Event.COMPLETE, LoadXML);
xmlLoader.load(newURLRequest("http://www.kirupa.com/net/files/sampleXML.xml")); function LoadXML(e:Event):void { xmlData = new XML(e.target.data); trace(xmlData);}
I get type was not found or is not a compile time constant pointing to line 9
which is 'function LoadXML(e:Event):void {' Can someone explain how to fix
this and why it's causing an error?
This code gives an error every time.
var xmlLoader:URLLoader = new URLLoader();
var xmlData:XML = new XML();
xmlLoader.addEventListener(Event.COMPLETE, LoadXML);
xmlLoader.load(newURLRequest("http://www.kirupa.com/net/files/sampleXML.xml")); function LoadXML(e:Event):void { xmlData = new XML(e.target.data); trace(xmlData);}
I get type was not found or is not a compile time constant pointing to line 9
which is 'function LoadXML(e:Event):void {' Can someone explain how to fix
this and why it's causing an error?