
Код:
function createRectangle (mc:MovieClip, x:Number, y:Number, w:Number, h:Number, radius:Number):Void {
var r:Number = 0;
if (radius != undefined || radius > 1) {
r = radius;
}
h += y;
w += x;
mc.moveTo (x + r, y + 0);
mc.lineTo (w - r, y + 0);
if (r != 0) {
mc.curveTo (w, y, w, y + r);
}
mc.lineTo (w, h - r);
if (r != 0) {
mc.curveTo (w, h, w - r, h);
}
mc.lineTo (x + r, h);
if (r != 0) {
mc.curveTo (x, h, x, h - r);
}
mc.lineTo (x, y + r);
if (r != 0) {
mc.curveTo (x, y, x + r, y);
}
}
this.beginFill (0);
createRectangle (this, 100, 100, 200, 400, 30);
this.endFill ();