Hello all,
I have a simple external XML file :
<?xml version=“1.0” encoding=“iso-8859-1”?>
<nouveautes>
<nouvelle1>This is content 1</nouvelle1>
<nouvelle2>This is content 2</nouvelle2>
</nouveautes>
I have a simple loading script on a key frame :
news = new LoadVars();
news.load(“nouvelles.xml”);
news.onLoad = function(success){
if(success){
nouvelle1 = news.firstChild;
nouvelle2 = news.nouvelle1.nextSibling;
}
else {
trace (“Error while loading file”);
}
}
stop();
On my scene, I have 2 dynamic text fields.
One called content1, the other called content2.
I want my textfield named content1 to show the content of the nouvelle1 variable (news.firstChild).
and my textfield named content2 to show the content of the nouvelle2 variable (news.nouvelle1.nextSibling).
What do I need to do?
I have tried to write “nouvelle1” in the Var field of my content1 textfield and “nouvelle2” in the Var field of my content2 textfield but this doesn’t work.
Any ideas would be appreciated.
Thanks! :}
neuhaus3000