0 Replies Latest reply on Jul 20, 2007 10:22 PM by Newsgroup_User

    xml to text field via array.

    Level 7
      I am loading my xml document into a text field, via an array. I am
      wondering, how I can do this and then take out the commas that the array
      is adding?

      I am bringing my content in like this:

      var aInfoText:Array = new Array;
      this.scroller_all.scroller_slider.infoScroll.textbox.autoSize = true;

      var xmlContent:XML = new XML();
      xmlContent.ignoreWhite = true;
      xmlContent.onLoad = function(bSuccess:Boolean):Void {
      if(bSuccess){
      trace("Loaded the xml successfully");

      var xnRoot = this.firstChild;
      var xnInfo = xnRoot.childNodes[0];

      for(var i:Number = 0; i < xnInfo.childNodes.length; i++){
      aInfoText.push(xnInfo.childNodes .firstChild.nodeValue);

      if(i == xnInfo.childNodes.length - 1){

      scroller_all.scroller_slider.infoScroll.textbox.htmlText = aInfoText;
      }
      }
      }
      };
      xmlContent.load("about.xml");


      The content in the XML document looks like this:

      <the_content>
      <info_text>
      <section_header>INFO</section_header>

      <headline>Some headline</headline>
      <bodycopy>Some content</bodycopy>

      <headline>Some headline</headline>
      <bodycopy>Some content</bodycopy>
      </info_text>
      </the_content>



      The commas show between the childNodes, but I don't want them there at
      all. How would I do that?

      Thanks a lot!