duplicatemovieclip question
- Started
- Last post
- 5 Responses
- sinisnap
ok i know i'm a complete flash retard, but i'm trying to get duplicatemovieclip to work and it just won't do it.
so i made an mc, dropped it on stage, named the instance "circle".
added this code to the mc:
onClipEvent (load) {
scale = (random(100) + 50)this._x = random(250);
this._y = random(150);
this._alpha = random(100);
this._xscale = scale;
this._yscale = scale;
}added this code to the frame:
amount = 20;
while(amount>0) {
duplicateMovieClip (circle, "circle" + i, i);
i = i + 1;
amount = amount-1;
}but it will only draw one circle when i test the movie. granted it's of a random size, placement and alpha level...but why only one???
- material-10
sounds like you might need to loop it
- sinisnap0
ah ok, point taken...thanks
so, i've put the instance of the mc and the action for the frame in another mc and put that on the stage.
now i get two circles...and that's all.
even more confusing!
- acescence0
where are you defining the variable i?
- sinisnap0
in the frame code:
amount = 20;
while(amount>0) {
duplicateMovieClip (circle, "circle" + i, i);
i = i + 1;
amount = amount-1;
}is that not right?
- sinisnap0
aha!
thank you acescence!i added: i=1;
in the frame code and now all is goooood.thanks again guys..knew it had to be something simple!