# Trouble using \_x in a if statement

**URL:** <https://forum.kirupa.com/t/trouble-using--x-in-a-if-statement/209404>\
**Category:** Uncategorized\
**Created:** [December 8, 2006, 2:08pm UTC](https://forum.kirupa.com/t/trouble-using--x-in-a-if-statement/209404 "2006-12-08T14:08:13Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![X\_dB](https://avatars.discourse-cdn.com/v4/letter/x/9dc877/32.png) [@X\_dB](https://forum.kirupa.com/u/X_dB)\
**Post date:** [December 8, 2006, 2:08pm UTC](https://forum.kirupa.com/t/trouble-using--x-in-a-if-statement/209404/1 "2006-12-08T14:08:13Z")

</div>

what i want to do is have a movie play i.e a rectangle move to point x from y at the click of a button, and at the click of another button, the rectangle should move from point x to point y; when the movie returns to point y, another frame should be loaded.  
for example, check the following codes:

on frame 1:  
stop;  
butt.onRelease = function () {  
gotoAndStop (2)  
}  
//butt is a instance name for a button//

on frame 2:  
stop;  
EndX = 200;  
FinalX = 10;  
mc.onEnterFrame = function () {  
mc.\_x += (EndX - mc.\_x)/10;  
}  
butt.onRelease = function () {  
mc.\_x += (FinalX - mc.\_x)/10;  
if (mc.\_x == FinalX) {  
gotoAndStop (3)  
}  
}  
// mc is an instance name for a movieclip //

the movie will play forth and back but frame 3 will never come up; PLEASE IF YOU CAN HELP ME FIX THIS CODE I BEG YOU.
