Hello, im new here and im having a bit of trouble on a project for school.
I’m trying to make a moving star field using a for loop and duplicateMovieClip, but when I try to add more than one duplicateMovieClip statement, it ends up only doing the last one… so for example, with the sample code at the bottom, it would only make 20 small blue stars, instead of doing each one.
I have no idea why it wont do each one, probably because im really new to Flash, and Actionscript.
Any help is appreciated!
This code is on its own frame on the root timeline. Ill be happy to provide any more information if needed.
for (r=0; r<20; r++) {
redstar_mc.duplicateMovieClip("redstar"+r,r,{_x:Math.random()*500, _y:Math.random()*800});
greenstar_mc.duplicateMovieClip("greenstar"+r,r,{_x:Math.random()*500, _y:Math.random()*800});
bluestar_mc.duplicateMovieClip("bluestar"+r,r,{_x:Math.random()*500, _y:Math.random()*800});
smallredstar_mc.duplicateMovieClip("smallredstar"+r,r,{_x:Math.random()*500, _y:Math.random()*800});
smallgreenstar_mc.duplicateMovieClip("smallgreenstar"+r,r,{_x:Math.random()*500, _y:Math.random()*800});
smallbluestar_mc.duplicateMovieClip("smallbluestar"+r,r,{_x:Math.random()*500, _y:Math.random()*800});
}