PDA

View Full Version : variable on URLLoader getting data



Janno
July 22nd, 2009, 08:30 PM
Hello.

Im working with this little sidescroller tile based game, im saving maps to xml file.

But got this little problem.
I would like to do something like this.

var currentLevel:int = 1;
var myMap:String = "map" + currentLevel;

var myMap = xmlData.myMap.tiles.text();

so i would like to put that variable to that getting data from xml so if my currentLevel changes its getting diffrent data from xml file.

so is that possible to put variable to that xmlData.myMap.tiles.text();

thanks for help.

Janno
July 22nd, 2009, 09:19 PM
okay, i figured it out.

i was stupid :P

var map:XMLList = xmlData.map.(@LEVEL == _currentLevel).tiles.text();

found that from kirupa xml tutorial so thanks for that :).

sorry for making this thread.