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
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.
onClipEvent(load) {
gridx=10;
gridy=10;
num=0;
for (var i=0;i < 10;i++)
{
for (var j=0;j < 10;j++)
{
duplicateMovieClip("_root.square.grid","grid"+num,num);
// ** This isn't working (But the trace output looks correct)**
/*
mc=["grid"+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
}