1 Reply Latest reply on Mar 17, 2012 7:25 AM by Ned Murphy

    Creating a RSS (feed) reader in Flash with AS2

    fificienta

      Hi everybody and thank you for reading. I´m working in a rss reader for my website, that has already a rss channel created. I created this in a file that is called news.rss. So I made the interface of the reader in Flash, and then continue inserting a code. But when I try the swf, it just shows the title of my channel, but any of my news. What is the problem? Here is my code: 

       

      var rssurl:String = "http://amorenaccion.netau.net/news.rss";

      //var rssurl:String = "unijimpe.xml";

      var rssxml:XML = new XML();

      rssxml.ignoreWhite = true;

      rssxml.load(rssurl);

      rssxml.onLoad = function() {

          var nodo:XMLNode = rssxml.firstChild.firstChild;

          var vtit:String = "";

          var vurl:String = "";

          var vdes:String = "";

          var vcon:String = "";

         

          for (i=0; i<nodo.childNodes.length; i++) {

              var snodo:XMLNode = nodo.childNodes[i];

              switch (snodo.nodeName) {

                  case "title":

                      vtit = snodo.firstChild.nodeValue;

                  break;

                  case "link":

                      vurl = snodo.firstChild.nodeValue;

                  break;

                  case "description":

                      vdes = snodo.firstChild.nodeValue;

                  break;

                 

              }

          }

          txttitle.htmlText = "<a href=\"" + vurl + "\">" + vtit + "</a>";

          txtdescription.text = vdes;

          txtcontent.htmlText = vcon;

      }

       

      function getContent(vxml) {

          var stit:String = "";

          var surl:String = "";

          var sdes:String = "";

          for (j=0; j<vxml.childNodes.length; j++) {

              var sxml:XMLNode = vxml.childNodes[j];

              switch (sxml.nodeName) {

                  case "title":

                      vtit = sxml.firstChild.nodeValue;

                  break;

                  case "link":

                      vurl = sxml.firstChild.nodeValue;

                  break;

                  case "description":

                      vdes = sxml.firstChild.nodeValue;

                  break;

              }

          }

          return "<a href=\""+vurl+"\"><b><font color=\"#990000\">"+vtit+"</font></b></a><br>"+vdes+"<br><br>";

      }