all groups > flash actionscript > may 2004 >
You're in the

flash actionscript

group:

array + duplicateMovieClip help!


array + duplicateMovieClip help! Heresy2k4
5/9/2004 7:02:28 PM
flash actionscript:
I want to duplicate a movie clip multiple times using a for statement. but in
order to edit each one in the same statement, i need to use arrays. and i can't
seem to get it right. heres what I've tried:

myarray = new Array();
for(x = 1; x < 9; x++) {
duplicateMovieClip("abc", "myarray[" add x add "]", 1);
myarray[x]._x = 50(x);
}

and this...

myarray = new Array();
for(x = 1; x < 9; x++) {
duplicateMovieClip("abc", "myarray[x]", 1);
myarray[x]._x = 50(x);
}

and this....

myarray = new Array();
for(x = 1; x < 9; x++) {
name = "myarray[" add x add "]";
duplicateMovieClip("abc", name, 1);
myarray[x]._x = 50(x);
}


and I just can't make it work. Can someone show me what to do? Thanks.
Re: array + duplicateMovieClip help! stwingy
5/9/2004 7:35:36 PM
myArray = new Array;
for (x=1; x<9; x++) {
duplicateMovieClip("abc", "abc"+x, x);
this["abc"+x]._x = x*50;
myArray.push(this["abc"+x])
}
you don`t actually need an array for this but you may need for something else.
Re: array + duplicateMovieClip help! stwingy
5/9/2004 7:36:25 PM
AddThis Social Bookmark Button