1 Reply Latest reply on May 5, 2006 10:47 PM by Marghoob Suleman

    Loading text by XML

    Jay_Neck
      Hi:

      I am very new to XML so I would like to know if someone could help me, this should be very simple. I have a textbox in my flash movie that will display the main text (only a short paragraph); my client wants that text to be loaded by XML but I do not know how to do that because these are my very first steps with XML.

      Any help, sample file or recommendation will be appreciated. Greetings from Argentina.
        • 1. Re: Loading text by XML
          Marghoob Suleman Level 1
          var my_xml:XML = new XML()
          my_xml.ignoreWhite = true
          my_xml.load("yourtext.xml")
          my_xml.onLoad = function(success) {
          if(success) {
          parseXML(this)
          }

          }

          function parseXML(xml) {
          my_xml = xml
          textvalue = my_xml.firstChild.childNodes[0].firstChild.nodeValue;
          my_txt.text = textvalue
          trace(textvalue);
          }

          =============
          this is xml
          <Dataset>
          <text id="1">this is your text</text>
          </Dataset>