3 Replies Latest reply on May 30, 2009 3:23 PM by kglad

    Using HTML tags in XML

    domconlon Level 1

      Trying to bring in an xml document that contains HTML tags but I can't seem to get it working.


      I have a bit of AS and a basic text field in a movie clip for now. I've pared it down as simply as I can to the following AS:


      var languageXML:XML = new XML();
      var nav:Array = new Array();
      languageXML.ignoreWhite = true;
      languageXML.onLoad = function(success) {
          var currentNavNode:XMLNode = this.firstChild.firstChild;
          var i:Number = 0;
          for (var childNode = currentNavNode; childNode != null; childNode=childNode.nextSibling, i++) {
              for (var stringNode:XMLNode = childNode.firstChild; stringNode != null; stringNode=stringNode.nextSibling, j++) {
                  _root.feature0 = stringNode.firstChild.nodeValue
          //all the xml has now loaded so we're good to kick off the full nav
          _root.textWin.myText.html = true;
          _root.textWin.myText.htmlText = _root.feature0;


      Whilst my XML doc looks like this:


      <?xml version="1.0" encoding="utf-8"?>


          <body><![CDATA[This<br>Should<br><br>Be fine.]]></body>