7 Replies Latest reply on Dec 21, 2015 7:18 AM by Colin Holgate

    Gradual sketching

    spersid

      I want to sketch about half of a circle. It must play smoothly, as drawn with a compass. Shape tweening does not work well. I did it sketching the circle frame-by-frame (using oval primitive tool and increasing the degrees at each frame). Again it looks clumsy. Does anybody know another way?

        • 1. Re: Gradual sketching
          kglad Adobe Community Professional & MVP

          do you want to animate an arc (ie, line) that ends displaying a semi-circle?

          • 3. Re: Gradual sketching
            spersid Level 1

            Yes, exactly. An arc of different degrees each time.

            • 4. Re: Gradual sketching
              kglad Adobe Community Professional & MVP

              you can use arcF to draw that arc:

               

              function arcF(centerX:int,centerY:int,radius:int,beginAngle:int,endAngle:int,color:uint):void{

              var mc:MovieClip = new MovieClip();

              addChild(mc);

              mc.x=centerX;

              mc.y=centerY;

              mc.radius=radius;

              mc.beginAngle=beginAngle;

              mc.endAngle=endAngle;

              mc.color=color

              mc.inc=1;

              mc.graphics.lineStyle(0,color);

              mc.graphics.moveTo(radius*Math.cos(beginAngle*Math.PI/180),radius*Math.sin(beginAngle*Math .PI/180));

              mc.addEventListener(Event.ENTER_FRAME,drawF);

              }

              function drawF(e:Event):void{

              var mc:MovieClip = MovieClip(e.currentTarget);

              mc.graphics.lineTo(mc.radius*Math.cos((mc.beginAngle+mc.inc)*Math.PI/180),mc.radius*Math.s in((mc.beginAngle+mc.inc)*Math.PI/180));

              mc.inc++;

              if(mc.beginAngle+mc.inc>mc.endAngle){

              mc.removeEventListener(Event.ENTER_FRAME,drawF);

              }

              }

              • 5. Re: Gradual sketching
                spersid Level 1

                Yes, it is a solution. However, since the fla file is very long, I have 3 FPS to cover all material. Hence it does not appear to be a smooth drawing.

                 

                Tanks, anyway.

                 

                Sotirios

                • 6. Re: Gradual sketching
                  kglad Adobe Community Professional & MVP

                  i don't understand why or if you've set your fps to 3, but if your fps is unintentional you should fix that.

                  • 7. Re: Gradual sketching
                    Colin Holgate MVP & Adobe Community Professional

                    For very long timelines you can work a different way. Have a movieclip in frame 1, that can have up to 16,000 frames. In the last frame you can put a script, on these lines:

                     

                    MovieClip(parent).gonext();

                     

                    In the 'gonext' function that is in the main timeline you would go into frame 2, where another movieclip of up to 16,000 frames can be, which continues the animation from the first movielclip. Using this approach you can increase your frame rate.