# \[Flash8\] looping childNodes

**URL:** <https://forum.kirupa.com/t/flash8-looping-childnodes/228271>\
**Category:** flash\
**Created:** [June 6, 2007, 4:35pm UTC](https://forum.kirupa.com/t/flash8-looping-childnodes/228271 "2007-06-06T16:35:49Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![bardic](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/bardic/32/3708_2.png) [@bardic](https://forum.kirupa.com/u/bardic)\
**Post date:** [June 6, 2007, 4:35pm UTC](https://forum.kirupa.com/t/flash8-looping-childnodes/228271/1 "2007-06-06T16:35:49Z")

</div>

Hey all,  
I am having some troubles with my XML. What seems to be the problem to me is that when I try to get the a childNode using a like and referencing an idex, its getting that childNodes children and so on. Or so I think. I’m likely wrong though since I still can’t figure it out.

Anyways, here’s the AS:

```auto
var container_xml:XML = new XML();
 container_xml.onLoad = startXML;
 container_xml.load("container_xml.xml");
 container_xml.ignoreWhite = true;
  function startXML(success){
    if (success == true){
       rootNode = container_xml.firstChild
    }
 }
  ........
  xmlLength = rootNode.childNodes;
    for(i=0;i<xmlLength.length; i++){
       currentNode = xmlLength*;      
       
       xmlLength = rootNode.currentNode.childNodes;      
       for(ii=0;ii<xmlLength.length; ii++){         
          firstKid = xmlLength.firstChild;
          heightOffSet = parseInt(firstKid.firstChild);
          centerOffSet = parseInt(firstKid.nextSibling.firstChild);
       }   
    }

```

_just a note_ I have removed the second for loop since I didn’t think it was doing anything useful.

And the XML:

```auto
<root>
    <container a="container">
       <h>10</h>
       <o>0</o>
    </container>
 </root>

```

That isn’t my entire AS, but just the XML parts. The rest can be posted if someone think it will help.

Thanks in advance 🙂
