# How to use this action script?

**URL:** <https://forum.kirupa.com/t/how-to-use-this-action-script/57719>\
**Category:** Uncategorized\
**Created:** [July 15, 2004, 4:05pm UTC](https://forum.kirupa.com/t/how-to-use-this-action-script/57719 "2004-07-15T16:05:20Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![felipegm](https://avatars.discourse-cdn.com/v4/letter/f/e9bcb4/32.png) [@felipegm](https://forum.kirupa.com/u/felipegm)\
**Post date:** [July 15, 2004, 4:05pm UTC](https://forum.kirupa.com/t/how-to-use-this-action-script/57719/1 "2004-07-15T16:05:20Z")

</div>

Hi.

I´ve got on robert penners web site some exemples of action script for ease and elastic movement. here is one of the codes I´m trying to apply on a movie to start.

```auto
class com.robertpenner.easing.Elastic {
	static function easeIn (t:Number, b:Number, c:Number, d:Number, a:Number, p:Number):Number {
		if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3;
		if (!a || a < Math.abs(c)) { 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;
	}
	static function easeOut (t:Number, b:Number, c:Number, d:Number, a:Number, p:Number):Number {
		if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3;
		if (!a || a < Math.abs(c)) { a=c; var s=p/4; }
		else var s = p/(2*Math.PI) * Math.asin (c/a);
		return (a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b);
	}
	static function easeInOut (t:Number, b:Number, c:Number, d:Number, a:Number, p:Number):Number {
		if (t==0) return b; if ((t/=d/2)==2) return b+c; if (!p) p=d*(.3*1.5);
		if (!a || a < Math.abs(c)) { a=c; var s=p/4; }
		else var s = p/(2*Math.PI) * Math.asin (c/a);
		if (t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
		return a*Math.pow(2,-10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )*.5 + c + b;
	}
}
{

```

Could someone point me some way of usage of theses codes? where to put them? or point me some tutorials or threads?

Thanks

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 15, 2004, 8:49pm UTC](https://forum.kirupa.com/t/how-to-use-this-action-script/57719/2 "2004-07-15T20:49:22Z")

</div>

Do you use Flash MX or Flash MX 2004?

If you use Flash MX 2004 then there is an easier way, they have their own built in Tween class.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 15, 2004, 9:22pm UTC](https://forum.kirupa.com/t/how-to-use-this-action-script/57719/3 "2004-07-15T21:22:34Z")

</div>

I´m using 2004.  
Don´t know it very much. It´s brand new.

How is that easy way???

Thanks

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 15, 2004, 9:53pm UTC](https://forum.kirupa.com/t/how-to-use-this-action-script/57719/4 "2004-07-15T21:53:19Z")

</div>

> I´m using 2004.  
> Don´t know it very much. It´s brand new.

How is that easy way???

There is a class in Flash MX 2004 that’s undocumented. Called the tween class.

These are the type of effects it can create linear movement, bounce effect, elastic effect, and more 😃

By having abit of code you can create any of the above effect, provided that your also using a function or similar.

Refer to this tutorial [DEWA89 | LINK ALT DAFTAR DAN LOGIN VPN89.ME/DEWA89](http://www.actionscript.org/tutorials/advanced/Tween-Easing_Classes_Documented/index.shtml)

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 15, 2004, 10:24pm UTC](https://forum.kirupa.com/t/how-to-use-this-action-script/57719/5 "2004-07-15T22:24:16Z")

</div>

Thanks

I´ll take a look at that.
