I want to use html tags in a xml file. I’ve read almost everything I could find about it but it still doesn’t work (for me).
xml file:
<?xml version=“1.0” encoding=“iso-8859-1”?>
<news>
<newsNode newsTitle=“Title 1” newsText=“This is the text of the first news. <B>Bla bla bla</B> <a href=“http://www.whatever.com”>click hier</a>. Bla bla bla”></newsNode>
<newsNode newsTitle=“Title 2” newsText=“This is the text of the second news. <B>I want this bold</B> <a href=“http://www.whatever.com”>this has to be a link</a>. Bla bla bla”></newsNode>
</news>
Actionscript in Flash:
news_xml = new XML();
news_xml.onLoad = startnewshow;
news_xml.load(“news.xml” <http://www.were-here.com/forum/smilies/wink.gif> ;
news_xml.ignoreWhite = true;
//
// Show the first news and intialize variables
function startnewshow(success) {
if (success == true) {
rootNode = news_xml.firstChild;
totalnews = rootNode.childNodes.length;
firstnewsNode = rootNode.firstChild;
currentnewsNode = firstnewsNode;
currentIndex = 1;
updatenews(firstnewsNode);
}
}
//
// Updates the current news with new image and text
function updatenews(newnewsNode) {
newsTitle = newnewsNode.attributes.newsTitle;
newsText = newnewsNode.attributes.newsText;
targetClip.loadMovie(newsTitle);
}
//
// Event handler for ‘Next news’ button
next_btn.onRelease = function() {
nextnewsNode = currentnewsNode.nextSibling;
if (nextnewsNode == null) {
break;
} else {
currentIndex++;
updatenews(nextnewsNode);
currentnewsNode = nextnewsNode;
}
};
//
// Event handler for ‘Previous news’ button
back_btn.onRelease = function() {
previousnewsNode = currentnewsNode.previousSibling;
if (previousnewsNode == null) {
break;
} else {
currentIndex–;
currentnewsNode = previousnewsNode;
updatenews(previousnewsNode);
}
};
I’ve try many things, but I can’t get it working.
Can someone help me with this.
worfoual