
Код AS3:
MovieClip.prototype.drawCircle = function(center, rad, fillColor, fillAlpha, lineColor, lineAlpha, lineWidth) {
trace(center[0]+", "+center[1]+", "+rad+", "+fillColor+", "+fillAlpha+", "+lineColor+", "+lineAlpha+", "+lineWidth);
controlOffset = Math.sin(24*Math.PI/180)*rad;
if (!fillColor) {
// if fillColor is not specified black is assigned @ alpha 100%
fillColor = 0x000000;
fillAlpha = 100;
}
if (lineColor) {
// if lineColor is specified a line is drawn, if not not
// if lineWidth is not specified width is set @ 1 pixel
// if lineAlpha is not specified alpha is set @ 100%
lineStyle(lineWidth+1*(lineWidth == undefined), lineColor, lineAlpha+100*(lineAlpha == undefined));
}
beginFill(fillColor, fillAlpha);
moveTo(center[0], center[1]-rad);
curveTo(center[0]+controlOffset, center[1]-rad, center[0]+Math.cos(45*Math.PI/180)*rad, center[1]-Math.sin(45*Math.PI/180)*rad);
curveTo(center[0]+rad, center[1]-controlOffset, center[0]+rad, center[1]);
curveTo(center[0]+rad, center[1]+controlOffset, center[0]+Math.cos(45*Math.PI/180)*rad, center[1]+Math.sin(45*Math.PI/180)*rad);
curveTo(center[0]+controlOffset, center[1]+rad, center[0], center[1]+rad);
curveTo(center[0]-controlOffset, center[1]+rad, center[0]-Math.cos(45*Math.PI/180)*rad, center[1]+Math.sin(45*Math.PI/180)*rad);
curveTo(center[0]-rad, center[1]+controlOffset, center[0]-rad, center[1]);
curveTo(center[0]-rad, center[1]-controlOffset, center[0]-Math.cos(45*Math.PI/180)*rad, center[1]-Math.sin(45*Math.PI/180)*rad);
curveTo(center[0]-controlOffset, center[1]-rad, center[0], center[1]-rad);
endFill();
};
_root.drawCircle([150, 150], 100, 0xFF0000, 100, 0x0000FF, 100, 4);