MACROMEDIA FLASH 8-FLASH LITE 2.X ACTIONSCRIPT LANGUAGE Reference page 459

Flash lite 2.x actionscript language reference
Hide thumbs Also See for FLASH 8-FLASH LITE 2.X ACTIONSCRIPT LANGUAGE:
Table of Contents

Advertisement

The following script uses the
this.createEmptyMovieClip("circle2_mc", 2);
circle2_mc.lineStyle(0, 0x000000);
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, '+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);
}
An example is also in the drawingapi.fla file in the ActionScript samples folder. The following
list gives typical paths to this folder:
Windows: boot drive\Program Files\Macromedia\Flash 8\Samples and
Tutorials\Samples\ActionScript
Macintosh: Macintosh HD/Applications/Macromedia Flash 8/Samples and Tutorials/
Samples/ActionScript
See also
beginFill (MovieClip.beginFill method)
(MovieClip.createEmptyMovieClip method)
lineStyle (MovieClip.lineStyle method)
moveTo (MovieClip.moveTo method)
method and the Math class to create a circle:
curveTo()
,
createEmptyMovieClip
,
endFill (MovieClip.endFill method)
,
lineTo (MovieClip.lineTo method)
,
Math
,
,
MovieClip
459

Advertisement

Table of Contents
loading

Table of Contents