Code:
function CreateRectangle (X, Y, XLength, YLength)
{
this.createEmptyMovieClip("rectangle_mc", 0);
drawRoundedRectangle(rectangle_mc, XLength, YLength, 0, 0xFFFFFF, 50);
rectangle_mc._x = X;
rectangle_mc._y = Y;
function drawRoundedRectangle(target_mc:MovieClip, boxWidth:Number, boxHeight:Number, cornerRadius:Number, fillColor:Number, fillAlpha:Number):Void {
with (target_mc) {
beginFill(fillColor, fillAlpha);
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();
}
}
}
Then I call it by this
Code:
CreateRectangle (120, 335, 520, 75);
How do I slowly strech it?
Thanks
-Evan