7 Replies Latest reply: Jan 2, 2011 9:34 AM by kglad RSS

    Need Some Help with XML Text loading

    d0brin Community Member

      So here is how i load my xml:

       

      var xmlLoader:URLLoader = new URLLoader();

      var xmlData:XML = new XML();

       

      xmlLoader.addEventListener(Event.COMPLETE, LoadXML);

       

      xmlLoader.load(new URLRequest("sampleXML.xml"));

      function LoadXML(e:Event):void {

      xmlData = new XML(e.target.data);

         trace(xmlData);


      }

       

      And it works. My question is what code to put to replace trace(xmlData); with code that will allow me the XML components be arranged in textfields. Here is how my XML is constructed:

       

      <xml>

      <slogan1>texttttt</slogan1>

      <slogan2>textttttt</slogan2>

      <slogan3>texttttt</slogan3>

      <slogan4>texttttttttttt</slogan4>

      </xml>

       

      What code to put in AS so when i start naming my textfields tf1,tf2,tf3,tf4 each line from the XML to go to its text field (like first line from the XML goes to tf1, second line to tf2 etc.)