# Problem with easing

**URL:** <https://forum.kirupa.com/t/problem-with-easing/59234>\
**Category:** Uncategorized\
**Created:** [July 29, 2004, 2:34pm UTC](https://forum.kirupa.com/t/problem-with-easing/59234 "2004-07-29T14:34:08Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![bigbadmilkman](https://avatars.discourse-cdn.com/v4/letter/b/9fc348/32.png) [@bigbadmilkman](https://forum.kirupa.com/u/bigbadmilkman)\
**Post date:** [July 29, 2004, 2:34pm UTC](https://forum.kirupa.com/t/problem-with-easing/59234/1 "2004-07-29T14:34:08Z")

</div>

I have a movie

when i press button 1 , i want the picture to move accross to a certain x co-ordinate, and i want it to ease there, so it goes smoothly.

The problem is that when i click on button 1 it doesn’t seem to move anything. I’ve attached the fla, I’d be grateful if anyone could help.

This is the sort of effect i want

[http://www.emilianorodriguez.com.ar/](http://www.emilianorodriguez.com.ar/)

---

<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 29, 2004, 2:48pm UTC](https://forum.kirupa.com/t/problem-with-easing/59234/2 "2004-07-29T14:48:45Z")

</div>

well the reason why button 1 doesnt work is because on the decks clip you loaded it on \_x = 100 and your button brings it to the same \_x = 100. The button works, but just not the way you wanted. Also on button 2 you should change the \_x = 250 to \_root.decks.\_x = 250. Your current code moves the whole stage to 250.

For the easing question, you should do a search for some easing functions. Easing is done usually done with onClipEvent(enterFrame) type of code. Just do a search with easing and you’ll find plenty of info.

---

<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 29, 2004, 2:50pm UTC](https://forum.kirupa.com/t/problem-with-easing/59234/3 "2004-07-29T14:50:40Z")

</div>

I only have MX so I can’t look at your file, but have you tried Voetsjoeba’s golden formula?

```auto

 MovieClip.prototype.easeX = function(to){
 this.onEnterFrame = function(){
 this._x = to-(to-this._x)/1.1;
 if(this._x > to-1 && this._x < to+1){
 this._x = to;
 delete this.onEnterFrame
 //do other stuff here, this is the point at which the object reaches its target
 }
 }
 }
 MC.easeX(100);

```

and for movement in the x, y direction:

```auto

MovieClip.prototype.ease = function(x,y){
  this.onEnterFrame = function(){
     this._x = x-(x-this._x)/1.1;
     this._y = y-(y-this._y)/1.1
     if(this._x > x-1 && this._x < x+1 && this._y > y-1 && this._y < y+1){
      this._x = x;
      this._y = y;
      delete this.onEnterFrame

      //do other stuff here, this is the point at which the object reaches its target
                 }
         }
 }

 MC.ease(100,100);

 

```

:hr:
