Hey all,
I have an XML file that I pull into Flash. I want the nodes of one parent node to trace, but I don’t want all of the children to be traced.
Here is my XML code:
<assets>
<project>My Title</project>
<tlo>My TLO</tlo>
<elo>My ELO</elo>
<audios>
<audio path="audio/audio1.wav"/>
<audio path="audio/audio2.wav"/>
<audio path="audio/audio3.wav"/>
<audio path="audio/audio4.wav"/>
<audio path="audio/audio5.wav"/>
<audio path="audio/audio6.wav"/>
<audio path="audio/audio7.wav"/>
<audio path="audio/audio8.wav"/>
<audio path="audio/audio9.wav"/>
<audio path="audio/audio10.wav"/>
</audios>
<texts>
<text>
<title>Title_a</title>
<sub>Sub1_a</sub>
<sub>Sub2_a</sub>
<sub>Sub3_a</sub>
</text>
<text>
<title>Title_b</title>
<sub>Sub1_b</sub>
<sub>Sub2_b</sub>
<sub>Sub3_b</sub>
</text>
<text>
<title>Title_c</title>
<sub>Sub1_c</sub>
<sub>Sub2_c</sub>
<sub>Sub3_c</sub>
</text>
<text>
<title>Title_d</title>
<sub>Sub1_d</sub>
<sub>Sub2_d</sub>
<sub>Sub3_d</sub>
</text>
<text>
<title>Title_e</title>
<sub>Sub1_e</sub>
<sub>Sub2_e</sub>
<sub>Sub3_e</sub>
</text>
</texts>
</assets>
I want:
<texts>
<text>
</text>
<text>
</text>
<text>
</text>
<text>
</text>
<text>
</text>
</texts>
In other words, I only want the ‘text’ nodes to pull-up inside of the parent ‘texts’, not their respected subs.
My AS code which is inside of the onLoad for the XML file:
ActionScript Code:
[FONT=Courier New][LEFT][COLOR=#0000FF]trace[/COLOR]COLOR=#000000[/COLOR];
[/LEFT]
[/FONT]
I want to grab the:
ActionScript Code:
[FONT=Courier New][LEFT]nodes.[COLOR=#0000FF]length[/COLOR]
[/LEFT]
[/FONT]
but I don’t want to include the subs.
Any help would be appreciated.