PDA

View Full Version : Duplicate clip problem


Pal3rm02k
03-27-2003, 10:15 AM
So i have this code but it makes 110 clips and i want just 100.I don't know why!

for (i=0; i<10; i++) {
n++;
for (j=0; j<10; j++) {
n++;
duplicateMovieClip ("clip", "clip"+n, n);
setProperty ("clip"+n, _x, j*50);
setProperty ("clip"+n, _y, i*50);
tellTarget ("clip"+n) {
gotoAndStop (1);
pozx = i;
pozy = j;
}
}
}
And another problem!!Every clip has 2 input type textfields pozx and pozy but when i test the movie, just the first clip has pozx and pozy modified, the rest were not modified!!!!

Cheers!!

CyanBlue
03-27-2003, 10:19 AM
Howdy...for (i = 0; i < 10; i++)
{
for (j = 0; j < 10; j++)
{
n++;
trace(n);
}
}

Pal3rm02k
03-27-2003, 10:24 AM
10x man!
that n++...........

but how about the variables??

catbert303
03-27-2003, 02:56 PM
try using array notation to set the variables in the clip.


for (i = 0; i < 10; i++)
{
for (j = 0; j < 10; j++)
{
n++;
var name = "clip" + n;
this.clip.duplicateMovieClip(name, n);
this[name]._x = j * 50;
this[name]._y = i * 50;
this[name].posx = i;
this[name].posy = j;
}
}