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:

AS Class File:


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);
//update the boxes postion/look
//set an onEnterFrame function for the box

//clear the onEnterFrame of the box

//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: