Flash Image Looping Question

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:

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:

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!