At curveTo Function,there is an example how to create a
circle by ActionScript:

quote:



this.createEmptyMovieClip(“circle2_mc”, 2);

circle2_mc.lineStyle(0, 0×000000);

drawCircle(circle2_mc, 100, 100, 100);

function drawCircle(mc:MovieClip, x:Number, y:Number,
r:Number):Void {

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);

}


should be changed:

this.createEmptyMovieClip(“circle2_mc”, 2);

circle2_mc.lineStyle(0, 0×000000);

drawCircle(circle2_mc, 100, 100, 100);

function drawCircle(mc:MovieClip, x:Number, y:Number,
r:Number):Void {

mc.moveTo(x+r, y);

mc.curveTo(r+x, Math.tan(Math.PI/8)*r+y, Math.
cos(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.
cos(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.
cos(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.
cos(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);

}

Related Photo:
http://www.mzwu.com/pic/20070618/001.gif

Related posts:

  1. X, Y coordinates question
  2. CTRL+Enter or "Test Movie" Locks Up Flash
  3. unloading a movie clip from a for statement
  4. unloading a movie clip from a for statement
  5. Random in function of time

Related posts brought to you by Yet Another Related Posts Plugin.

 Leave a Reply

(required)

(required)

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

   
© 2012 free icons download Suffusion theme by Sayontan Sinha

Featuring Recent Posts WordPress Widget development by YD