# Using Tween class to resize from centre of the image

**URL:** <https://forum.kirupa.com/t/using-tween-class-to-resize-from-centre-of-the-image/204534>\
**Category:** flash\
**Created:** [October 20, 2006, 4:21pm UTC](https://forum.kirupa.com/t/using-tween-class-to-resize-from-centre-of-the-image/204534 "2006-10-20T16:21:45Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Zaid\_W1red](https://avatars.discourse-cdn.com/v4/letter/z/cab0a1/32.png) [@Zaid\_W1red](https://forum.kirupa.com/u/Zaid_W1red)\
**Post date:** [October 20, 2006, 4:21pm UTC](https://forum.kirupa.com/t/using-tween-class-to-resize-from-centre-of-the-image/204534/1 "2006-10-20T16:21:45Z")

</div>

HEy guys,  
I have a rectangle on my stage called BG.

I want it to resize while remaining centre aligned, but when I use the following code:

import mx.transitions.Tween;  
import mx.transitions.easing.\*;

var bgwidth:Tween = new Tween(bg, “\_width”, Bounce.easeOut, 0, Stage.width, 3, true);  
var bgheight:Tween = new Tween(bg, “\_height”, Bounce.easeOut, 0, Stage.height, 3, true);

The top left corner of the rectanlge is aligned to the cnetre of the stage and it resizes from that point.

I;ve made sure the registration point of my shape is set to its centre also.

Can anyone help?
