PDA

View Full Version : XML - how to find out node position?



markP
February 16th, 2003, 11:23 AM
Without some kind of ID or numberTag attribute, how can I get the position of which slide I'm looking at? I know with "length" I can see that there 8 slide nodes. How can I find out which one is currently being displayed without making some kind of slide counter that increments by one if you go in order. In other words I want to display a list of images so they can click on any one and have a counter displayed for them that says something like "viewing slide #5 of 8". Is there a way to do this?

Thanks!




<Slides>
<slide>Slide 1 Here</slide>
<slide>Slide 2 Here</slide>
<slide>Slide 3 Here</slide>
<slide>Slide 4 Here</slide>
<slide>Slide 5 Here</slide>
<slide>Slide 6 Here</slide>
<slide>Slide 7 Here</slide>
<slide>Slide 8 Here</slide>
</Slides>

senocular
February 17th, 2003, 08:27 AM
nodes are stored as an array. Its just a matter of using the array index as a counter

if you're new to XML in flash, scan through the pages of http://www.kirupaforum.com/showthread.php?s=&threadid=13697 which breifly goes over XML in Flash

markP
February 18th, 2003, 10:30 AM
It's not so much the XML I'm having problems with as it is the ActionScript. So any help would be great.

Thanks