# XML Arrays question

**URL:** <https://forum.kirupa.com/t/xml-arrays-question/311433>\
**Category:** flash\
**Created:** [July 6, 2010, 4:57pm UTC](https://forum.kirupa.com/t/xml-arrays-question/311433 "2010-07-06T16:57:32Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ksarabey](https://avatars.discourse-cdn.com/v4/letter/k/eada6e/32.png) [@ksarabey](https://forum.kirupa.com/u/ksarabey)\
**Post date:** [July 6, 2010, 4:57pm UTC](https://forum.kirupa.com/t/xml-arrays-question/311433/1 "2010-07-06T16:57:32Z")

</div>

Hello,  
I’m trying to build a small basic map in AS2, everything is going ok but I have one problem I’m not being able to solve.  
I want to have the ability to disable countries in the map, by simply using \_invisible = true; or removeMovieClip();

I have the buttons instance names set in sequence as mc\_1 mc\_2 mc\_3 etc …  
in my XML, I have an attribute that displays “active” or “inactive” simply when it’s inactive I want it to remove the movieclip or make it invisible, I’m not being able to do it.  
here’s my code:

```auto
var btn_status:Array = new Array();
var btn_id:Array = new Array();
function loadXML(loaded) { 
if (loaded) {
var stats:Array = this.firstChild.childNodes;
for (s=0;s<stats.length;s++)
   {
      btn_status.push(stats[s].attributes.stat);
      btn_id.push(stats[s].attributes.id);
 
         if (stats[s].attributes.stat == "inactive")
         {
         var mc =["mc_"+stats[s].attributes.id];
         mc._visible = false;
 
         }
      }
   }
}
 
 
xmlData = new XML();
xmlData.ignoreWhite = true; 
xmlData.onLoad = loadXML;
xmlData.load("maps.xml");

```

since the buttons names are mc\_1 etc… I’m following that in my XML, so in the xml if the attribute id 1 is inactive it will disable the movieclip mc\_1 …

Any help would be appreciated, i’m sure it’s a tiny thing i’m missing here …  
I tried putting the array of inactive items in a variable and then use the variable to disable the buttons but also not working

Thanks in advance !
