# Walk off then on stage

**URL:** <https://forum.kirupa.com/t/walk-off-then-on-stage/298329>\
**Category:** Uncategorized\
**Created:** [October 16, 2009, 3:22pm UTC](https://forum.kirupa.com/t/walk-off-then-on-stage/298329 "2009-10-16T15:22:57Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ramart](https://avatars.discourse-cdn.com/v4/letter/r/58956e/32.png) [@ramart](https://forum.kirupa.com/u/ramart)\
**Post date:** [October 16, 2009, 3:22pm UTC](https://forum.kirupa.com/t/walk-off-then-on-stage/298329/1 "2009-10-16T15:22:57Z")

</div>

I have my movie clip walk off the left side of stage and come back on the right of the stage. but I cant get it to walk off the right and come back on the left can any one give advise please. this is what I have so far

onClipEvent(load) {  
var direction = “left”;  
var speed = 10 ;  
}

onClipEvent(enterFrame) {  
if(Key.isDown(Key.LEFT)){  
this.direction = “left”;  
this.\_x -= speed;  
this.gotoAndPlay(‘walkleft’);  
if(this.\_x\<0-this.\_width)this.\_x=Stage.width;  
} else if(Key.isDown(Key.RIGHT)) {  
this.direction = “right”;  
this.\_x += speed;  
this.gotoAndPlay(‘walkright’);  
//if(this.\_x\<0+this.\_width)this.\_x=Stage.width;  
} else {

```
            this.gotoAndPlay('wait'+this.direction);
        }
        trace(this._x);

```

}
