Create rectangles with rounded corners radius in ActionScript 2
Here's a function with which you're able to create a rectangle with rounded corner:
function drawRoundedRectangle(mc:MovieClip, rectWidth:Number, rectHeight:Number, cornerRadius:Number, fillColor:Number, fillAlpha:Number, lineThickness:Number, lineColor:Number, lineAlpha:Number) {
with (mc) {
beginFill(fillColor, fillAlpha);
lineStyle(lineThickness, lineColor, lineAlpha);
moveTo(cornerRadius, 0);
lineTo(rectWidth - cornerRadius, 0);
curveTo(rectWidth, 0, rectWidth, cornerRadius);
lineTo(rectWidth, cornerRadius);
lineTo(rectWidth, rectHeight - cornerRadius);
curveTo(rectWidth, rectHeight, rectWidth - cornerRadius, rectHeight);
lineTo(rectWidth - cornerRadius, rectHeight);
lineTo(cornerRadius, rectHeight);
curveTo(0, rectHeight, 0, rectHeight - cornerRadius);
lineTo(0, rectHeight - cornerRadius);
lineTo(0, cornerRadius);
curveTo(0, 0, cornerRadius, 0);
lineTo(cornerRadius, 0);
endFill();
}
}









on the contrary, for Flash 8 was originally written
//website not yet up to scratch
with flash 8 the with does not work
Perfect, and very concise. This is the best script on the web for drawing rounded rectangles.