# Flash Image Looping Question

**URL:** <https://forum.kirupa.com/t/flash-image-looping-question/228116>\
**Category:** flash\
**Created:** [June 5, 2007, 2:06pm UTC](https://forum.kirupa.com/t/flash-image-looping-question/228116 "2007-06-05T14:06:22Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Money4Shop](https://avatars.discourse-cdn.com/v4/letter/m/6a8cbe/32.png) [@Money4Shop](https://forum.kirupa.com/u/Money4Shop)\
**Post date:** [June 5, 2007, 2:06pm UTC](https://forum.kirupa.com/t/flash-image-looping-question/228116/1 "2007-06-05T14:06:22Z")

</div>

I am having some troubles making this mountain keep on looping. It goes across the screen but there’s a gap, I want it to continue going when it reaches one end of the screen it should already have been coming from the other side. My code for the object is:

```auto
onClipEvent(load){
 looping.duplicatedMovieClip("mountains");
 mountains._x=looping._x+looping._width;
 loopStartx=this._x
 loopSpeed=10;
}
onClipEvent(enterFrame) {
 if(_root.sky.loopStart){
  this._x-=loopSpeed;
  if(this._x<=(loopStartx-looping._width) ){
   this._x=loopStartx=loopSpeed;
  }
 }
}
 
      

```

and for the background it’s:

```auto
onClipEvent(load) {
 loopx=_root.ground.looping._width/3;
 loopStart=true;
}

```

I have attached the FLA file as well, if anyone could help that’d be great, Thanks!
