# Array Splice issue

**URL:** <https://forum.kirupa.com/t/array-splice-issue/242474>\
**Category:** Uncategorized\
**Created:** [October 26, 2007, 11:27am UTC](https://forum.kirupa.com/t/array-splice-issue/242474 "2007-10-26T11:27:22Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![trezbo](https://avatars.discourse-cdn.com/v4/letter/t/e99b99/32.png) [@trezbo](https://forum.kirupa.com/u/trezbo)\
**Post date:** [October 26, 2007, 11:27am UTC](https://forum.kirupa.com/t/array-splice-issue/242474/1 "2007-10-26T11:27:22Z")

</div>

Hi i am loading in and xml file based on the structure below…  
\<qID=“3.1a” level=“3” /\>  
\<qID=“3.1b” level=“3” /\>  
\<qID=“3.2a” level=“3” /\>  
\<qID=“3.2b” level=“3” /\> … etc all the way to 3.12b

So what i am trying to do is to Splice the array into 2 parts, all the question ID’s that are A and all that are B for for example are placed into 2 new array’s like so:  
level3a\_Array = [3.1a, 3.2a, 3.3a, 3.4a]  
level3b\_Array = [3.1b, 3.2b, 3.3b, 3.4b]

but i am having problems with the code below trying to splice them and seperate them, so any help would be great!!!

var diagnosticXml:XML = new XML();  
diagnosticXml.ignoreWhite = true;  
diagnosticXml.load(“databank/databank.xml”);  
diagnosticXml.onLoad = function(success:Boolean){  
if(success){  
aLevel = diagnosticXml.firstChild.childNodes;  
lev3Array = aLevel[0].childNodes;

```
	for(var a=12; a&gt;0; a--){
      var level_3:Number = _root.aLevel[0].childNodes.length;
      _root.aLevel[0].childNodes.splice(0, 1);
       lev3B_Array = _root.aLevel[0].childNodes.splice(0, 1);
	}
	trace("lev3Array: "+ lev3Array);
}

```

}
