# Adding easing to hitTest movement

**URL:** <https://forum.kirupa.com/t/adding-easing-to-hittest-movement/172540>\
**Category:** flash\
**Created:** [December 15, 2005, 11:10am UTC](https://forum.kirupa.com/t/adding-easing-to-hittest-movement/172540 "2005-12-15T11:10:23Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jerry](https://avatars.discourse-cdn.com/v4/letter/j/5daacb/32.png) [@jerry](https://forum.kirupa.com/u/jerry)\
**Post date:** [December 15, 2005, 11:10am UTC](https://forum.kirupa.com/t/adding-easing-to-hittest-movement/172540/1 "2005-12-15T11:10:23Z")

</div>

Hey Kirupa people… :thumb2:

I need a little help here: I’ve got a simple setup of to movieclips on stage, mc\_1 and mc\_2.

```auto
var theX = 120;
var theY = 90;

this.onEnterFrame = function() {
if(mc_1.hitTest(_root._xmouse, _root._ymouse, true)){
		mc_2._x = theX+((-_xmouse+theX)*(mc_2._width-mc_1._width)/mc_1._width);
		mc_2._y = theY+((-_ymouse+theY)*(mc_2._height-mc_1._height)/mc_1._height);
		}
	}

```

When you rollover mc\_1, mc\_2 start to move arcording to the x\_- and \_ymouse, I would like to add some easing to this movement - can this be done?

I’ve been messing around with += but I can’t quite figure it out…

Any help would be nice… 🙂
