A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: a formula for moving a moviel clip in a circuler motion??!!

  1. #1
    Registered User
    Join Date
    Sep 2000
    Posts
    186

    a formula for moving a moviel clip in a circuler motion??!!

    Hi,

    Does anybody know what the script would be for moving a movieclip in a cicular motion (looping).

    Any help much appreciated

  2. #2
    Senior Member
    Join Date
    Apr 2001
    Posts
    257
    Hi, use this.

    x = r*Math.cos(2*Math.PI*f*t)
    y = r*Math.sin(2*Math.PI*f*t)

    r = radius
    t = time
    f = revolutions per sec

    example

    onClipEvent(load) {
    r = 50;
    f = 0.01;
    t = 0;
    }

    onClipEvent(enterFrame){
    this._x = r*Math.cos(2*Math.PI*f*t);
    this._y = r*Math.sin(2*Math.PI*f*t);
    t++;
    }

    That should work let me know how you get on

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