# Whats the problem?

**URL:** <https://forum.kirupa.com/t/whats-the-problem/93299>\
**Category:** Uncategorized\
**Created:** [October 28, 2003, 8:07pm UTC](https://forum.kirupa.com/t/whats-the-problem/93299 "2003-10-28T20:07:05Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![yazzman](https://avatars.discourse-cdn.com/v4/letter/y/58956e/32.png) [@yazzman](https://forum.kirupa.com/u/yazzman)\
**Post date:** [October 28, 2003, 8:07pm UTC](https://forum.kirupa.com/t/whats-the-problem/93299/1 "2003-10-28T20:07:05Z")

</div>

Hi

Im trying to get this an object to go from position A to B and back, in infinity!!I only get the object to go from A to be B and then it stops. The code is in the MovieClip actions.

Here is the code…

onClipEvent (enterFrame) {

this.onEnterFrame=goRight;  
goRight=function()  
{  
if (this.\_y\<250) this.\_y+=1;  
else this.goLeft;  
}  
goLeft=function()  
{  
if (this.\_y\>50) this.\_y-=1;  
else this.goRight;  
}  
}

:mario:
