PDA

Click to See Complete Forum and Search --> : duplicating a movie clip round a circular path



bombadier
08-09-2002, 07:12 AM
Help needed to creating a duplicated movie clip that repeats round a circular path of a fixed radius:

eg. 50 duplications of a movie clip stepped round a circlular path of 200px radius...

Any suggestions?

Bombadier

ericlin
08-09-2002, 07:27 PM
A circle is 2*Math.PI; So, dividing it by 50 is the quantum arc.



qAngle = Math.PI*2/50;
radius = 200;
x0 = 250;
y0 = 200;
for (var k = 0; k<50; k++) {
mc.duplicateMovieClip("mc"+k, k+100);
var clip = this["mc"+k];
clip._x = x0+radius*Math.cos(qAngle*k);
clip._y = y0+radius*Math.sin(qAngle*k);
}