Rounded corners issue

Im in a hurry, so don’t give me the “please search before post”-talk. I need to draw a box with rounded corners. I can’t get a hang of it. I want to draw it from the following variables:

boxwidth = 200;
boxheight = 200;
radius = 5;

How do I draw this? You should see the artwork I have (by mistake) created while trying to get it right :stuck_out_tongue:

you cant script it. What you can do on the other hand is draw this figure using the drawing tools of flash…(lineTo and fill)

I think you are [color=Red]wrong[/color]. I am almost ready with a function which does exactly this. I hope …

done

So, show us your handywork!


 ////////////////////////////////////////////////////////////////////////////////////////////////////
 //  Draw rectangle (p)  ////////////////////////////////////////////////////////////////////////////
 //  www.votem.net  /////////////////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////////////////////////////////////
 MovieClip.prototype.draw_rect = function(x,y,w,h,r,lw,lc,la,fc,fa) {
 	with(this){
 		beginFill(fc,fa);
 		lineStyle(lw,lc,la);
 		moveTo(x+r,y);
 		lineTo(x+w-r,y);
 		curveTo(x+w,y,x+w,y+r);
 		lineTo(x+w,y+h-r);
 		curveTo(x+w,y+h,x+w-r,y+h);
 		lineTo(x+r,y+h);
 		curveTo(x,y+h,x,y+h-r);
 		lineTo(x,x+r);
 		curveTo(x,y,x+r,y);
 		endFill();
 	}
 }
 

I think you are wrong. I am almost ready with a function which does exactly this. I hope …

I think you didn’t understand my answer. What you did is exactly what I said should be done - didn’t you use the lineTo function ???

It’s been done before. What I meant is that there is no such function as drawRoundedRectangle(var,var,var,var,etc…)

:snooze: