# Variables and XML

**URL:** <https://forum.kirupa.com/t/variables-and-xml/182927>\
**Category:** flash\
**Created:** [March 22, 2006, 2:53pm UTC](https://forum.kirupa.com/t/variables-and-xml/182927 "2006-03-22T14:53:12Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![zooey74](https://avatars.discourse-cdn.com/v4/letter/z/a9a28c/32.png) [@zooey74](https://forum.kirupa.com/u/zooey74)\
**Post date:** [March 22, 2006, 2:53pm UTC](https://forum.kirupa.com/t/variables-and-xml/182927/1 "2006-03-22T14:53:12Z")

</div>

Hi,

I have the following code I’m working with:

```auto

gridx=28;
gridy=28;
num=0;
for (var i=0;i < 22;i++)
{
  for (var j=0;j < 22;j++)
  {
    square_mc.duplicateMovieClip("square"+num,num);
    mc=this["square"+num];
    mc._x=gridx*i;
    mc._y=gridy*j;
    num++;
  }
  
}

dot._visible=0;

function createbox_fn(k){
    for (k=11; k < 65;k++)
{
var srini =this["square"+k];
srini._alpha = 0;

}    
};

createbox_fn();

```

This is creating a series of little squares from the square\_mc movieclip and it’s erasing boxes numbered 11 through 65. What I need to be able to do is to use XML to change these numbers. So that if I change the XML document, for example to the number 33, then the actionscript will be changed to read k=33, thus erasing box number 33. Does that make any sense? I have some experience with XML but don’t know how to just plug it into a situation like this.

Please help and thank you for the help!
