1 Reply Latest reply on Aug 17, 2006 4:59 AM by Newsgroup_User

    Circular Motion in ActionScript Help

    ameer@litespeed.com.my
      drawCircle(this, 100, 100, 50);
      function drawCircle(mc:MovieClip, x:Number, y:Number, r:Number):Void {
      mc.lineStyle(2, 0xFF0000, 100);
      mc.moveTo(x+r, y);
      mc.curveTo(r+x, Math.tan(Math.PI/8)*r+y, Math.sin(Math.PI/4)*r+x, Math.sin(Math.PI/4)*r+y);
      mc.curveTo(Math.tan(Math.PI/8)*r+x, r+y, x, r+y);
      mc.curveTo(-Math.tan(Math.PI/8)*r+x, r+y, -Math.sin(Math.PI/4)*r+x, Math.sin(Math.PI/4)*r+y);
      mc.curveTo(-r+x, Math.tan(Math.PI/8)*r+y, -r+x, y);
      mc.curveTo(-r+x, -Math.tan(Math.PI/8)*r+y, -Math.sin(Math.PI/4)*r+x, -Math.sin(Math.PI/4)*r+y);
      mc.curveTo(-Math.tan(Math.PI/8)*r+x, -r+y, x, -r+y);
      mc.curveTo(Math.tan(Math.PI/8)*r+x, -r+y, Math.sin(Math.PI/4)*r+x, -Math.sin(Math.PI/4)*r+y);
      mc.curveTo(r+x, -Math.tan(Math.PI/8)*r+y, r+x, y);
      }


      can anyone xplain how can i manipulate this hard code so it can be a circular motion base on rotation/relative angle?
        • 1. Re: Circular Motion in ActionScript Help
          Level 7
          Hi!

          If you go to: http://www.gotoandlearn.com/
          and download Creating 3D Carousels (maybe II or III), then you will see some
          helpful code in there ... if I remember correctly.

          /Jensen/

          "ameer@litespeed.com.my" <webforumsuser@macromedia.com> wrote in message
          news:ec1ceo$f37$1@forums.macromedia.com...
          > drawCircle(this, 100, 100, 50);
          > function drawCircle(mc:MovieClip, x:Number, y:Number, r:Number):Void {
          > mc.lineStyle(2, 0xFF0000, 100);
          > mc.moveTo(x+r, y);
          > mc.curveTo(r+x, Math.tan(Math.PI/8)*r+y, Math.sin(Math.PI/4)*r+x,
          > Math.sin(Math.PI/4)*r+y);
          > mc.curveTo(Math.tan(Math.PI/8)*r+x, r+y, x, r+y);
          > mc.curveTo(-Math.tan(Math.PI/8)*r+x, r+y, -Math.sin(Math.PI/4)*r+x,
          > Math.sin(Math.PI/4)*r+y);
          > mc.curveTo(-r+x, Math.tan(Math.PI/8)*r+y, -r+x, y);
          > mc.curveTo(-r+x, -Math.tan(Math.PI/8)*r+y, -Math.sin(Math.PI/4)*r+x,
          > -Math.sin(Math.PI/4)*r+y);
          > mc.curveTo(-Math.tan(Math.PI/8)*r+x, -r+y, x, -r+y);
          > mc.curveTo(Math.tan(Math.PI/8)*r+x, -r+y, Math.sin(Math.PI/4)*r+x,
          > -Math.sin(Math.PI/4)*r+y);
          > mc.curveTo(r+x, -Math.tan(Math.PI/8)*r+y, r+x, y);
          > }
          >
          >
          > can anyone xplain how can i manipulate this hard code so it can be a
          > circular
          > motion base on rotation/relative angle?
          >