# Getting this Penner motion/easing function to work

**URL:** https://forum.kirupa.com/t/getting-this-penner-motion-easing-function-to-work/158564
**Category:** flash
**Created:** [August 10, 2005, 2:35pm UTC](https://forum.kirupa.com/t/getting-this-penner-motion-easing-function-to-work/158564 "2005-08-10T14:35:34Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![ericinho](https://avatars.discourse-cdn.com/v4/letter/e/9dc877/32.png) [@ericinho](https://forum.kirupa.com/u/ericinho)
#### Post date: [August 10, 2005, 2:35pm UTC](https://forum.kirupa.com/t/getting-this-penner-motion-easing-function-to-work/158564/1 "2005-08-10T14:35:34Z")

</div>

Hello,

I am attempting to get a MC to move/ease from down to up with the help of AS without resorting to tweens…

Mind you, I am still working with Flash5.

Right, I found this Robbert Penner function:

ActionScript:  
onClipEvent(load)  
{  
Math.easeInElastic = function (t, b, c, d, a, p) {  
if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d\*.3;  
if (a \< Math.abs ) { a=c; var s=p/4; }  
else var s = p/(2_Math.PI) \* Math.asin (c/a);  
return -(a_Math.pow(2,10\*(t-=1)) \* Math.sin( (t_d-s)_(2\*Math.PI)/p )) + b;  
};

}

I placed it on a MC (a different one from the ones mentioned below) on frame 1 on \_root

With it I want to make a MC (lets call this MC Bob) move from down to up (out of sight) after the timeline in another MC (hostMC) has reached a certain Frame (lets say frame 23).

Since I have to tell Flash to execute this function (which I am forced by Flash5 to put functions within a ActionScript:  
onClipEvent(load){  
}

I put ActionScript:

onClipEvent(load){  
\_root.bob.Math.easeInElastic;  
}

attached to another MC which I placed inside hostMC on frame 23.

Needless to say, it doesnt work.

But what am I doing wrong?
