# Convert an xml list to an array?

**URL:** <https://forum.kirupa.com/t/convert-an-xml-list-to-an-array/238044>\
**Category:** flash\
**Created:** [September 6, 2007, 4:43pm UTC](https://forum.kirupa.com/t/convert-an-xml-list-to-an-array/238044 "2007-09-06T16:43:21Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ocarson](https://avatars.discourse-cdn.com/v4/letter/o/e9bcb4/32.png) [@ocarson](https://forum.kirupa.com/u/ocarson)\
**Post date:** [September 6, 2007, 4:43pm UTC](https://forum.kirupa.com/t/convert-an-xml-list-to-an-array/238044/1 "2007-09-06T16:43:21Z")

</div>

Hi everyone, i’m running in to a little trouble with actionscript 3.0.

I have an xmlList object, but using the xmlList is very slow, so i want to copy the data in to an array.

I can do this using this loop.

```
//set up map data
        for (var j:uint = 1;j&lt;=layerData.length();j++){
            var temp:Array = new Array();
            for (var k:uint = 1;k&lt;=layerData[j].data.tile.@gid.length();k++){
            temp.push(layerData[j].data.tile.@gid[k]);
                
            }
            mapData[j] = temp;
            
        };

```

Problem is, its very slow, and causes lash to timeout, so is there a faster way to copy an xmllist contents to an array?
