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