# Tweening/resizing graphics.drawRoundRect

**URL:** <https://forum.kirupa.com/t/tweening-resizing-graphics-drawroundrect/289692>\
**Category:** flash\
**Created:** [June 3, 2009, 12:59pm UTC](https://forum.kirupa.com/t/tweening-resizing-graphics-drawroundrect/289692 "2009-06-03T12:59:47Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![youwh](https://avatars.discourse-cdn.com/v4/letter/y/82dd89/32.png) [@youwh](https://forum.kirupa.com/u/youwh)\
**Post date:** [June 3, 2009, 12:59pm UTC](https://forum.kirupa.com/t/tweening-resizing-graphics-drawroundrect/289692/1 "2009-06-03T12:59:47Z")

</div>

I used AS3 to create a rounded edges box, and when the window resize i wanted to keep the ellipse height and width of the edges. How can I do that?

Creating the box

```auto
private function detectStage(e:Event=null):void {

            roundRect.graphics.beginFill(0xFFFFFF,1);

            roundRect.graphics.drawRoundRect(boxX,boxY,boxWidth,boxHeight,10,10);
            //drawRoundRect ( x , y , width , height , ellipse width , ellipse height )
            
roundRect.graphics.endFill();
            addChild(roundRect);
        }

```

This 1 the box doesnt change

```auto
createBoxx.roundRect.graphics.drawRoundRect(createBoxx.boxX,createBoxx.boxY,sContent.width,sContent.height,10,10);

```

This makes the overall size strech

```auto
widthTween=new Tween(sBox,"width",Elastic.easeOut,sBox.width,boxWidth,2,true);
heightTween=new Tween(sBox,"height",Elastic.easeOut,sBox.height,boxHeight,2,true);

```
