# Elasticity

**URL:** <https://forum.kirupa.com/t/elasticity/87922>\
**Category:** flash\
**Created:** [April 25, 2005, 10:46am UTC](https://forum.kirupa.com/t/elasticity/87922 "2005-04-25T10:46:12Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![tolgainam](https://avatars.discourse-cdn.com/v4/letter/t/bbe5ce/32.png) [@tolgainam](https://forum.kirupa.com/u/tolgainam)\
**Post date:** [April 25, 2005, 10:46am UTC](https://forum.kirupa.com/t/elasticity/87922/1 "2005-04-25T10:46:12Z")

</div>

Hi,  
Im using the fallowing code for a smooth movement for objects, the thing I want is I also want it to be like elastic.

MovieClip.prototype.closefolder = function(newidth, newheight, speed, loader) {  
this.onEnterFrame = function() {  
current\_w = this.\_width;  
current\_h = this.\_height;  
this.\_width -= (current\_w-newidth )/speed;  
this.\_height -= (current\_h-newheight)/speed;  
};

How to do that ?  
thanks
