# \[MX\] Another easing question

**URL:** <https://forum.kirupa.com/t/mx-another-easing-question/24620>\
**Category:** Uncategorized\
**Created:** [July 2, 2003, 9:26pm UTC](https://forum.kirupa.com/t/mx-another-easing-question/24620 "2003-07-02T21:26:56Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Keith130](https://avatars.discourse-cdn.com/v4/letter/k/b38774/32.png) [@Keith130](https://forum.kirupa.com/u/Keith130)\
**Post date:** [July 2, 2003, 9:26pm UTC](https://forum.kirupa.com/t/mx-another-easing-question/24620/1 "2003-07-02T21:26:56Z")

</div>

Hi I have this MC and I need it to move, so surprises there. I have this on the MC [AS]onClipEvent(load){  
musicNormalX = \_x;  
musicNormalY = \_y;  
musicTargetX = \_x;  
musicTargetY = \_y;  
easeSpeed = 1000;  
}  
onClipEvent(enterFrame){  
this.\_x += (musicNormalX - musicTargetX)/easeSpeed;  
this.\_y += (musicNormalY - musicTargetY)/easeSpeed;  
}[/AS]

And then this on a button :

[AS]on(release){  
\_root.music.musicTargetX = 10;  
\_root.music.musicTargetY = 10;  
}[/AS]

The MC ID is music as you could tell from the button code. What happens is that the MC moves. But then it doesn’t stop!!! Well I am puzzled out of ideas.

---

<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 2, 2003, 9:38pm UTC](https://forum.kirupa.com/t/mx-another-easing-question/24620/2 "2003-07-02T21:38:05Z")

</div>

Doesnt matter I fixed if by using [AS]onClipEvent(load){  
musicTargetX = \_x;  
musicTargetY = \_y;  
easeSpeed = 1000;  
}  
onClipEvent(enterFrame){  
this.\_x += (musicNormalX - \_x)/easeSpeed;  
this.\_y += (musicNormalY - \_y)/easeSpeed;  
}[/AS]

Its was using a fixed var before but now it uses the current \_x and \_y to calculate the next position.
