1 Reply Latest reply on May 16, 2007 4:01 AM by Simon Bailey

    Actionscript not working with Player 8

      Hi,

      I got this script from the internet but it only work when you published it with Flash player 6 & actionscript 1 . Can anyone help me to translate it so that it can be use for player 8 & actionscript 2.

      Here's the code -

      // The first step is to activate the XML object
      headlineXML = new XML();
      /*
      With the XML Object now active you must now load an XML foramtted document.
      Any DTD or XLS formatting will be ignored.
      */
      headlineXML.onLoad = myLoad;
      headlineXML.load("headlines.xml");
      // Before proceeding to far into the program, make sure the XML document has loaded
      // Extract information from the XML file
      function myLoad(ok) {
      if (ok == true) {
      Publish(this.firstChild);
      }
      }

      function Publish(HeadlineXMLNode) {
      if (HeadlineXMLNode.nodeName.toUpperCase() == "BROADCAST") {
      content = "";
      story = HeadlineXMLNode.firstChild;
      while (story != null) {
      if (story.nodeName.toUpperCase() == "STORY") {
      lead = "";
      body = "";
      URL = "";
      element = story.firstChild;
      while (element != null) {
      if (element.nodeName.toUpperCase() == "LEAD") {
      lead = element.firstChild.nodeValue;
      }
      if (element.nodeName.toUpperCase() == "BODY") {
      body = element.firstChild.nodeValue;
      }
      if (element.nodeName.toUpperCase() == "URL") {
      URL = element.firstChild.nodeValue;
      }
      element = element.nextSibling;
      }
      content += "<font size='+2' color='#3366cc'><a href='"+URL+"'>"+lead+"</a></font><br>"+body+"<br><br>";
      txt.htmltext=content;
      }
      story = story.nextSibling;
      }
      }
      }

      Thank you so much!