# XML Variables

**URL:** https://forum.kirupa.com/t/xml-variables/85147
**Category:** flash
**Created:** [April 2, 2005, 5:04am UTC](https://forum.kirupa.com/t/xml-variables/85147 "2005-04-02T05:04:41Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Fydus](https://avatars.discourse-cdn.com/v4/letter/f/8c91f0/32.png) [@Fydus](https://forum.kirupa.com/u/Fydus)
#### Post date: [April 2, 2005, 5:04am UTC](https://forum.kirupa.com/t/xml-variables/85147/1 "2005-04-02T05:04:41Z")

</div>

I’m trying to save an array of numbers within my xml file and load it into an array in flash. My xml code is simple

\<A\>  
\<B map="[0,0,0,0,0]" /\>  
\</A\>

I want to save this into my flash client program…

//-----------------------------------------------------------  
//declare xml variable  
var xml:XML = new XML();  
var map:Array;  
xml.ignoreWhite = true;

//onload of xml file  
xml.onLoad = function(success)  
{  
//if success, get array  
if(success)  
map = this.firstChild.firstChild.attributes.map;  
//trace array  
trace(map[0]);  
}

//load text file  
xml.load(“test.xml”);  
//-----------------------------------------------------------

The trace returns an undefined…

The reason I’m trying to get this is so I can make a tile based game… Going to send a matrix through so multiple people can load the map…

Thanks
