QUOTE(karunai @ 3 Nov, 2007 - 07:00 AM)

Hi
Anyone help me to draw rectangle with cuvred corner using action script
ive been using this function for years, it does the job well.
CODE
function drawRoundedCornerRectangle(target_mc:MovieClip, boxWidth:Number,
boxHeight:Number, cornerRadius:Number, fillColor:Number,
fillAlpha:Number, lineThickness:Number, lineColor:Number, lineAlpha:Number):Void {
with (target_mc) {
beginFill(fillColor, fillAlpha);
lineStyle(lineThickness, lineColor, lineAlpha);
moveTo(cornerRadius, 0);
lineTo(boxWidth - cornerRadius, 0);
curveTo(boxWidth, 0, boxWidth, cornerRadius);
lineTo(boxWidth, cornerRadius);
lineTo(boxWidth, boxHeight - cornerRadius);
curveTo(boxWidth, boxHeight, boxWidth - cornerRadius, boxHeight);
lineTo(boxWidth - cornerRadius, boxHeight);
lineTo(cornerRadius, boxHeight);
curveTo(0, boxHeight, 0, boxHeight - cornerRadius);
lineTo(0, boxHeight - cornerRadius);
lineTo(0, cornerRadius);
curveTo(0, 0, cornerRadius, 0);
lineTo(cornerRadius, 0);
endFill();
}
}
An Example of using it is as follows:
CODE
this.createEmptyMovieClip("MockTest_background", _root.getNextHighestDepth());
MockTest_background._x = 50;
MockTest_background._y = 110;
drawRoundedCornerRectangle(MockTest_background, 650, 290, 8, 0xFFFFFF, 25, 2, 0xFFFFFF, 100);