Hello everyone.
I have some trouble with a dynamic xml text project.
I am using the following xml:
<?xml version="1.0"?>
<About>
<box>
<title>[COLOR=Red]My Work[/COLOR]</title>
<comment>[COLOR=DarkOrange]Text Here[/COLOR].</comment>
</box>
<box>
<title>[COLOR=DeepSkyBlue]My Photographs[/COLOR]</title>
<comment>[COLOR=Plum]Text Here[/COLOR].</comment>
</box>
</About>
Now.On flash:
I have four dynamic text fields.
The one is called title1_txt(which is for “[COLOR=Red]My Work[/COLOR]” title).
The other one is called box1_txt(which is for “[COLOR=DarkOrange]Text Here[/COLOR]” comment).
These work just fine with the ActionScript I am going to link to you.
**
What I want to achieve**: title2_txt( I want it to be “[COLOR=DeepSkyBlue]My Photographs[/COLOR]” title).
box2_txt( I want it to be “[COLOR=Plum]Text Here[/COLOR]” comment).
What do I have to edit on the following ActionScript in order to do that?
function loadXML(loaded) {
if (loaded) {
_root.About = this.firstChild.childNodes[0].childNodes[0].firstChild.nodeValue;
_root.comments = this.firstChild.childNodes[0].childNodes[1].firstChild.nodeValue;
title1_txt.text = _root.About;
box1_txt.text = _root.comments;
[COLOR=Red] title2_txt.text = _root.About;[/COLOR]
[COLOR=Red] box2_txt.text = _root.comments;[/COLOR]
} else {
trace("file not loaded!");
}
}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("About.xml");
Thanks in advance