# Tween class -shink a square to its original position

**URL:** <https://forum.kirupa.com/t/tween-class-shink-a-square-to-its-original-position/287415>\
**Category:** Uncategorized\
**Created:** [April 30, 2009, 6:34pm UTC](https://forum.kirupa.com/t/tween-class-shink-a-square-to-its-original-position/287415 "2009-04-30T18:34:29Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![nwglow](https://avatars.discourse-cdn.com/v4/letter/n/f1d935/32.png) [@nwglow](https://forum.kirupa.com/u/nwglow)\
**Post date:** [April 30, 2009, 6:34pm UTC](https://forum.kirupa.com/t/tween-class-shink-a-square-to-its-original-position/287415/1 "2009-04-30T18:34:29Z")

</div>

When I mouseover the square and it expands and when I mouseout the square it should shrink back to its original position. The expandSquare works but the shrinkSquare doesn’t. **How do I fix it?**

* * *

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

square\_mc.addEventListener(MouseEvent.MOUSE\_OVER, expandSquare);  
square\_mc.addEventListener(MouseEvent.MOUSE\_OUT, shrinkSquare);

function expandSquare(e:MouseEvent):void  
{  
new Tween(e.currentTarget, “width”, Regular.easeOut, e.currentTarget.width, stage.stageWidth/2, 1, true);  
new Tween(e.currentTarget, “height”, Regular.easeOut, e.currentTarget.height, stage.stageHeight/2, 1, true);  
}

function shrinkSquare(e:MouseEvent):void  
{  
new Tween(e.currentTarget, “width”, Regular.easeOut, stage.stageWidth/2, e.currentTarget.width, 1, true);  
new Tween(e.currentTarget, “height”, Regular.easeOut, stage.stageHeight/2, e.currentTarget.height, 1, true);  
}
