# Easing goes back to original \_x

**URL:** <https://forum.kirupa.com/t/easing-goes-back-to-original--x/60205>\
**Category:** Uncategorized\
**Created:** [August 7, 2004, 7:22pm UTC](https://forum.kirupa.com/t/easing-goes-back-to-original--x/60205 "2004-08-07T19:22:53Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![julpa](https://avatars.discourse-cdn.com/v4/letter/j/e47c2d/32.png) [@julpa](https://forum.kirupa.com/u/julpa)\
**Post date:** [August 7, 2004, 7:22pm UTC](https://forum.kirupa.com/t/easing-goes-back-to-original--x/60205/1 "2004-08-07T19:22:53Z")

</div>

so yeah im trying to do this easing menu bar thing and it keeps going back to the same postion and i cant figure out why, its kind of acting like \_X is a constant instead of its current \_x. heres a link to the actual [http://www.geocities.com/tigeronfire445/pinkrobots/pinkRobots1.htm](http://www.geocities.com/tigeronfire445/pinkrobots/pinkRobots1.htm)  
and yeah.

i can e-mail somebody the fla if theyre interested but yeah.

the way i have it set-up is once you click one of the buttons it goes a to a frame and the “bar” (the orange bar thing) in that frame has enter frame AS on it any ways heres the AS on the bar.

onClipEvent(enterFrame) {  
speed = 5  
endX = -163.4;  
\_x += (endX-\_x)/speed;  
}

thanks  
spencer

---

<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:** [August 8, 2004, 4:15am UTC](https://forum.kirupa.com/t/easing-goes-back-to-original--x/60205/2 "2004-08-08T04:15:16Z")

</div>

without looking at the fla,  
i think you need to  
not keyframe the gradient thing  
and with each of the buttons  
write something like:“  
on(release){  
\_root.bar.endX = - 163’  
}  
”

---

<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:** [August 8, 2004, 12:12pm UTC](https://forum.kirupa.com/t/easing-goes-back-to-original--x/60205/3 "2004-08-08T12:12:09Z")

</div>

that is pretty weird, I cant see why its doing that. An .fla might be helpful.

---

<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:** [August 8, 2004, 1:05pm UTC](https://forum.kirupa.com/t/easing-goes-back-to-original--x/60205/4 "2004-08-08T13:05:28Z")

</div>

I think expensive\_pen is pushing you in the right direction. you’re setting the var endX on enterframe, so whatever you put in the button, it’s overwritten and therefore it will allways go to -163.4  
Try this

```auto
onClipEvent (load) {
	speed = 5;
	//goes at start to -163.4
	endX = -163.4;
}
onClipEvent (enterFrame) {
	_x += (endX-_x)/speed;
}

```

and on your button

```auto
on (release) {
	//set the value you want to ease to
	_root.bar.endX = -100;
}

```

scotty(-:

---

<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:** [August 9, 2004, 1:18am UTC](https://forum.kirupa.com/t/easing-goes-back-to-original--x/60205/5 "2004-08-09T01:18:21Z")

</div>

awesome help scptty worked perfectly.

---

<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:** [August 9, 2004, 6:12am UTC](https://forum.kirupa.com/t/easing-goes-back-to-original--x/60205/6 "2004-08-09T06:12:47Z")

</div>

welcome=)
