# Problem with nested movieclip

**URL:** https://forum.kirupa.com/t/problem-with-nested-movieclip/148500
**Category:** Uncategorized
**Created:** [May 20, 2005, 12:11pm UTC](https://forum.kirupa.com/t/problem-with-nested-movieclip/148500 "2005-05-20T12:11:56Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![on\_the\_fly](https://avatars.discourse-cdn.com/v4/letter/o/90ced4/32.png) [@on\_the\_fly](https://forum.kirupa.com/u/on_the_fly)
#### Post date: [May 20, 2005, 12:11pm UTC](https://forum.kirupa.com/t/problem-with-nested-movieclip/148500/1 "2005-05-20T12:11:56Z")

</div>

Hi All,

i am trying to follow some of the tutorials on this site as i am new to flash. I am stuck a little bit with this one:

[http://www.kirupa.com/developer/actionscript/grid.htm](http://../developer/actionscript/grid.htm)

I get it working on the main timeline. But if i try to nest the replicated movieclip inside another movie i don’t get it working.

So, i have a mc called ‘square’. Inside this one i have placed the mc ‘grid’. I want to do with grid exatly the same that has been done in the tutorial.

But the mc=[“grid”+num] syntax seems not to work. If i call the grids directly with grid0.\_x=gridx\*2 their is no problem.

Thanks for your help.

```auto

onClipEvent(load) {
gridx=10;
gridy=10;
num=0;
for (var i=0;i < 10;i++)
{
  for (var j=0;j < 10;j++)
  {
	duplicateMovieClip(&quot;_root.square.grid&quot;,&quot;grid&quot;+num,num);
// **This isn't working (But the trace output looks correct)**
	/*
	  mc=[&quot;grid&quot;+num];
	  mc._x=gridx*i;
	  mc._y=gridy*j;
	  trace(mc);
	*/
	num++;
  }
}
// **But this is working (But i don't want to do this for every single one ;-)**
grid0._x=gridx*2;
grid0._y=gridy*2;
grid1._x=gridx*3;
grid1._y=gridy*3;

_root.square.grid._visible=0

}

```
