A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: duplicating a movie clip round a circular path

  1. #1
    Junior Member
    Join Date
    Apr 2002
    Posts
    18
    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

  2. #2
    Senior Member
    Join Date
    May 2001
    Posts
    1,838
    A circle is 2*Math.PI; So, dividing it by 50 is the quantum arc.

    Code:
    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);
    }

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center