# Resizing a box using tween class

**URL:** <https://forum.kirupa.com/t/resizing-a-box-using-tween-class/231414>\
**Category:** flash\
**Created:** [July 4, 2007, 3:37pm UTC](https://forum.kirupa.com/t/resizing-a-box-using-tween-class/231414 "2007-07-04T15:37:41Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sam\_Goudie](https://avatars.discourse-cdn.com/v4/letter/s/bbe5ce/32.png) [@Sam\_Goudie](https://forum.kirupa.com/u/Sam_Goudie)\
**Post date:** [July 4, 2007, 3:37pm UTC](https://forum.kirupa.com/t/resizing-a-box-using-tween-class/231414/1 "2007-07-04T15:37:41Z")

</div>

Hey guys,

I need to make a white box change size using actionscript when a button is clicked. The code I’ve got at the moment is:

on (release) {  
import mx.transitions.easing.\*;  
import mx.transitions.Tween;  
var tw:Tween = new Tween(yourmc, “\_width”, mx.transitions.easing.Strong.easeOut, start(number value), finish(number value), time(in frames), false);  
var tw2:Tween = new Tween(yourmc, “\_height”, mx.transitions.easing.Strong.easeOut, start(number value), finish(number value), time(in frames), false); }

Doesn’t work, but it should. The movie clip that needs to change size is named as a variable as well as exporting for actionscript.

Basically I need the box to change size from what ever size it is at that moment (captured using a variable I think) and then tweening to a size defined by the button.

So i need help in working out:

1. How to capture the size as a variable (or if there is a simpler way please let me know!)
2. why the code above doesn’t work!

Cheers in advance

Sam
