Hey,
Does anyone know how to read attributes in XML?
This is my frame ActionScript.
news = new XML();
news.ignoreWhite = true;
news.load(“nouvelles.xml”);
news.onLoad = function(success){
if(success){
rootNode = news.firstChild;
nouvelle1 = rootNode.firstChild;
nouvelle2 = nouvelle1.nextSibling;
}
else {
trace (“Error while loading file”);
}
}
This is my nouvelles.xml external document:
<?xml version=“1.0” encoding=“iso-8859-1”?>
<nouveautes>
<nouvelle1>This is news 1</nouvelle1>
<nouvelle2>This is news 2</nouvelle2>
</nouveautes>
I have 2 text fields in my movie.
One that will read the attributes of <nouvelle 1></nouvelle1>
and the other the attributes of <nouvelle 2></nouvelle2>.
But what is showing in the textfields is :
textfield #1 = <nouvelle1>This is news 1</nouvelle1>
and
textfield #2 = <nouvelle2>This is news 2</nouvelle2>
I just want the “This is news 1” and “This is news 2” without the <nouvelle1></nouvelle1> and <nouvelle2></nouvelle2> tags.
Any ideas what’s missing in my frame actionScript?
Thanks! :beam:
neuhaus3000