I've been struggling with a rather simple thing and I cannot find the solution. I want to load a local XML file (which can be found in Flashbuilder4 under "/src") in ActionScript3.
Here is the code I used for the function:
var xmlLoader:URLLoader = new URLLoader();
var xmlData:XML = new XML(); xmlLoader.load(
new URLRequest("yogi.xml")); //
I also tried to replace "yogi.xml" with the exact file path, but it does not work at all. If I write the XML-manually into the Actionscript code the trace works perfect...but that is of course not the way to go....what am I doing wrong here....?
Loading is asynchronous. You have to wait for Event.COMPLETE
Thank you. I have created a second function receiving the event and transfering its data into a new XML-object. It seems to work now although the debug editor opens up for some reason...and when I open the SWF a second time I am not getting any console outs...well, but my questions is answered. Thanks again! =)