# Actionscript problem

**URL:** <https://forum.kirupa.com/t/actionscript-problem/224844>\
**Category:** Uncategorized\
**Created:** [May 6, 2007, 4:42am UTC](https://forum.kirupa.com/t/actionscript-problem/224844 "2007-05-06T04:42:26Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![aenie09](https://avatars.discourse-cdn.com/v4/letter/a/8edcca/32.png) [@aenie09](https://forum.kirupa.com/u/aenie09)\
**Post date:** [May 6, 2007, 4:42am UTC](https://forum.kirupa.com/t/actionscript-problem/224844/1 "2007-05-06T04:42:26Z")

</div>

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!
