Block with round corners

I always noticed that if you have a block with round corners that the rounds never looked good unless the _xscale/_yscale ratio didn’t change… so today I wrote a class to handle it for me. Its all actionscript and draws you a block with round corners. It dosen’t handle exactly like a movieclip… but I’ll be using it in the future for sure:

SWF: http://jsites.no-ip.com/Flash/exp/roundBlock/roundBlock.swf
AS Class File: http://jsites.no-ip.com/Flash/exp/roundBlock/roundBlock.as
FLA: http://jsites.no-ip.com/Flash/exp/roundBlock/roundBlock.fla
ZIP: http://jsites.no-ip.com/Flash/exp/roundBlock/roundBlock.zip

Usage:


//initialize
round = new roundBlock("uniqueMovieClipName", initialWidth, initialHeight, initialXPosition, initialYPosition, initialAlpha, initialColor);

function mover() {
this._par._x = 15;
this._par._y = 20;
//set the postion of the top left corner of the box to (15, 20);
this._par.update();
//update the boxes postion/look
}
//set an onEnterFrame function for the box
round.setOnEnterFrame(mover);

//clear the onEnterFrame of the box
round.clearOnEnterFrame();

//Available properties:
_width //set the width of the box
_height //set the height of the box
_x //the x postion of the left side of the box
_y //the y position of the top of the box
_alpha //the alpha of the box
_roundSize //the width/height of the bevel
_bgcolor //the color of the box (0xFFFFFF format)

/*------------
Use _par as a reference in the movieclip to refer to its parent roundBlock class (as seen in the onEnterFrame function above)
--------------
You must call the update() function everytime you wish to update the box
Therefore you must use this._par.update() in all onEnterFrame functions
*/

I hope that I explained well enough :slight_smile: