# Adding elasticity to my scrolling function

**URL:** <https://forum.kirupa.com/t/adding-elasticity-to-my-scrolling-function/178600>\
**Category:** flash\
**Created:** [February 12, 2006, 12:54pm UTC](https://forum.kirupa.com/t/adding-elasticity-to-my-scrolling-function/178600 "2006-02-12T12:54:11Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![5TEF](https://avatars.discourse-cdn.com/v4/letter/5/85e7bf/32.png) [@5TEF](https://forum.kirupa.com/u/5TEF)\
**Post date:** [February 12, 2006, 12:54pm UTC](https://forum.kirupa.com/t/adding-elasticity-to-my-scrolling-function/178600/1 "2006-02-12T12:54:11Z")

</div>

Hi,

i’ve got a cool scrolling function, that i often (always ;-)) use  
( because it’s a simple and easy to adapting to Y, X, scale…) :  
\*  
[COLOR=Red]function scrolling(nom, coord, coef) {  
nom.onEnterFrame = function() {  
this.\_x += (coord-this.\_x)\*coef;  
if (this.\_x == coord) {  
delete this.onEnterFrame;  
}  
};  
}[/COLOR]

\*I want to add to this function an elastic effect…but as i’m not a head in physic, maybe someone can help me ?

thanks !  
stef
