Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 02-19-2007, 06:14 PM   #1
lariat1997
Registered User
 
Join Date: Jan 2005
Posts: 72
Question help with XML structure and tracing in Flash.

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:
: trace(this.firstChild.firstChild.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling);

I want to grab the:
ActionScript Code:
: nodes.length
but I don't want to include the subs.

Any help would be appreciated.
lariat1997 is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump


All times are GMT. The time now is 03:20 AM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.