# Easing/Tweening in AS2

**URL:** https://forum.kirupa.com/t/easing-tweening-in-as2/319599
**Category:** flash
**Created:** [February 25, 2011, 8:41pm UTC](https://forum.kirupa.com/t/easing-tweening-in-as2/319599 "2011-02-25T20:41:18Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![lletdownl](https://avatars.discourse-cdn.com/v4/letter/l/6a8cbe/32.png) [@lletdownl](https://forum.kirupa.com/u/lletdownl)
#### Post date: [February 25, 2011, 8:41pm UTC](https://forum.kirupa.com/t/easing-tweening-in-as2/319599/1 "2011-02-25T20:41:18Z")

</div>

Hello everyone, im trying to create this custom menu a bit more efficiently. As written, it operates fine glitch free. However, id like to incorporate some easing into the movement of each movie clip.

```auto
mc_ddTyp.onPress = function() {
	MenuMove(this,-180.0,-80.0);
	MenuMove(mc_Typplus,-175.0,-75.0)
	MenuMove(mc_Typminus,-175.0,-75.0)
	MenuMove(mc_ddSignature,-220.0,-120.0);
	MenuMove(mc_searchBtnA,-260.0,-160.0);

	fade(mc_ddTypFull);
	fade(mc_Typplus);

};

function MenuMove(target, EndLoc, StartLoc) {
	if (target._y == StartLoc) {
		MoveUp(target,EndLoc);
	} else {
		MoveDown(target,StartLoc);
	}
}

function MoveUp(target, EndLoc) {
	target.onEnterFrame = function() {
		target._y -= 10;
		if (target._y<=EndLoc) {
			delete target.onEnterFrame;
		}
	};
}

function MoveDown(target, StartLoc) {
	target.onEnterFrame = function() {
		target._y += 10;
		if (target._y>=StartLoc) {
			delete target.onEnterFrame;
		}
	};
}

function fade(target) {
	if (target._visible == false) {
		fadeIn(target);
	} else {
		(fadeOut(target));
	}
}

function fadeIn(target) {
	target._visible = true;
	target._alpha = 0;
	target.onEnterFrame = function() {
		target._alpha += 10;
		if (target._alpha>=100) {
			target._alpha = 100;
			delete target.onEnterFrame;
		}
	};
}

function fadeOut(target) {
	target._alpha = 100;
	target.onEnterFrame = function() {
		target._alpha -= 10;
		if (target._alpha<=0) {
			target._alpha = 0;
			target._visible = false;
			delete target.onEnterFrame;
		}
	};

}

```

can anyone help me out how to incorporate tween classes and then easing?

thanks a lot
