2 Replies Latest reply on Apr 22, 2010 3:56 PM by YogiKlatt

    Loading a local XML file in actionscript?

    YogiKlatt

      Hi,

      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")); //

       

      trace(xmlData.item.(menuName=="burger").price);

       

      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....?