4 Replies Latest reply on Jul 7, 2007 9:37 AM by Newsgroup_User

    XML to Array to html text

    Level 7
      I am trying to get the content of my xml document into a text field. I
      have the following AS:


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

      var xmlContent:XML = new XML();
      xmlContent.ignoreWhite = true;
      xmlContent.onLoad = function(bSuccess:Boolean):Void {
      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){
      this.scroller_all.scroller_slider.infoScroll.infoText.htmlText = aInfoText;


      I can't seem to get the content inside my text field. I know the text
      field works fine, and if I do a trace inside the second ifStatment, I
      get what I want to go in the text field.

      What am I doing wrong?

      Thank you!