0 Replies Latest reply on May 11, 2007 9:12 AM by samuels2921

    Myspace Profile

    samuels2921
      Hello, I recently asked about loading an mp3 player xml playlist from the html parameter "flashvars", now that i have my mp3 player working perfect on myspace i figured maybe i can use the same parameters for a myspace layout. I have an RSS Reader Designed to read the blogs and used a component loader to load the jpg shown own the myspace. My question is whats wrong. the mp3 player works great but my rss loader and photo component loader is having problems. Heres the codes I have.


      -------------------------------- HTML code ------------------------------

      <param name="flashvars" value="xmlpath=http://www.mysite.net/myspaceplaylist.xml& rsspath=http://blog.myspace.com/blog/rss.cfm?friendID=4010127&csspath=http://www.mysite.ne t/mo_rss.css&photopath=http://a580.ac-images.myspacecdn.com/01316/97/56/photo.jpg" />
      </object>



      ---------- Photo Loader (loader component) ****first frame of (_root.mysarea) ***** -------


      this.myspacepcarea.picloader.loaders.loaderw
      .loadMovie( photopath);
      I-------------+------------------I----------+-----------+-----I
      loaders destination



      -------------------------------- RSS Loader ****first frame of (_root.blog.rssbloger) ***** ----------

      The RSS Loader has 2 files referenced to the HTML file. variable names csspath and rsspath. CSSpath is reference to the css layout of the rss loader.

      trace ( _root.rsspath);
      trace ( _root.csspath);
      var rss_css:TextField.StyleSheet = new TextField.StyleSheet();
      rss_css.onLoad = function(success:Boolean) {
      if (success) {
      trace("css loaded...");
      function not_set_yet() {
      loadDATA();
      }
      }
      };
      rss_css.load( _root.csspath);
      // ************************************************
      // Load XML data
      // ************************************************
      btnLoad.onRelease = function() {
      loadDATA();
      };
      function loadDATA() {
      var rss_xml:XML = new XML();
      rss_xml.ignoreWhite = true;
      rss_xml.onLoad = function(success:Boolean) {
      if (success) {
      processData(rss_xml);
      } else {
      trace("unable to load/parse cnet.xml");
      }
      };
      rss_xml.load( _root.rsspath);
      }
      // ***********************************************
      // Process Data
      // ***********************************************
      channel_title = "";
      channel_desc = "";
      channel_copyright = "";
      channel_link = "";
      channel_lang = "";
      function processData(rm) {
      var rss = rm.firstChild.firstChild;
      item_txt.text = "";
      item_txt.html = true;
      item_txt.styleSheet = rss_css;
      for (i=0; i<rss.childNodes.length; i++) {
      //trace(rss.childNodes .nodeName);
      if (rss.childNodes
      .nodeName == "title") {
      channel_title = rss.childNodes .firstChild.nodeValue;
      } else if (rss.childNodes
      .nodeName == "description") {
      channel_description = rss.childNodes .firstChild.nodeValue;
      } else if (rss.childNodes
      .nodeName == "copyright") {
      channel_copyright = rss.childNodes .firstChild.nodeValue;
      } else if (rss.childNodes
      .nodeName == "link") {
      channel_link = rss.childNodes .firstChild.nodeValue;
      } else if (rss.childNodes
      .nodeName == "language") {
      channel_lang = rss.childNodes .firstChild.nodeValue;
      } else if (rss.childNodes
      .nodeName == "image") {
      var sTitle;
      var sLink;
      // link
      var sURL;
      // logo url
      txtLogo.html = true;
      txtLogo.htmlText = "";
      for (j=0; j<rss.childNodes .childNodes.length; j++) {
      if (rss.childNodes
      .childNodes[j].nodeName == "title") {
      sTitle = rss.childNodes .childNodes[j].firstChild.nodeValue;
      } else if (rss.childNodes
      .childNodes[j].nodeName == "link") {
      sLink = rss.childNodes .childNodes[j].firstChild.nodeValue;
      } else if (rss.childNodes
      .childNodes[j].nodeName == "url") {
      sURL = rss.childNodes .childNodes[j].firstChild.nodeValue;
      }
      }
      } else if (rss.childNodes
      .nodeName == "item") {
      var itemTitle;
      var itemDesc;
      var itemLink;
      for (j=0; j<rss.childNodes .childNodes.length; j++) {
      if (rss.childNodes
      .childNodes[j].nodeName == "title") {
      itemTitle = rss.childNodes .childNodes[j].firstChild.nodeValue;
      } else if (rss.childNodes
      .childNodes[j].nodeName == "description") {
      itemDesc = rss.childNodes .childNodes[j].firstChild.nodeValue;
      } else if (rss.childNodes
      .childNodes[j].nodeName == "link") {
      itemLink = rss.childNodes .childNodes[j].firstChild.nodeValue;
      }
      }
      item_txt.htmlText += "<a href=\""+itemLink+"\"><span class=\"headline\">"+itemTitle+"</span></a><br><span class=\"thread\">"+itemDesc+"</span><br>";
      }
      }
      }
      loadDATA();
      __________________________________________________________________________