# Scrolling movieClip: Loop within set area?

**URL:** <https://forum.kirupa.com/t/scrolling-movieclip-loop-within-set-area/293485>\
**Category:** flash\
**Created:** [July 29, 2009, 6:21pm UTC](https://forum.kirupa.com/t/scrolling-movieclip-loop-within-set-area/293485 "2009-07-29T18:21:48Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![landrvr1](https://avatars.discourse-cdn.com/v4/letter/l/f07891/32.png) [@landrvr1](https://forum.kirupa.com/u/landrvr1)\
**Post date:** [July 29, 2009, 6:21pm UTC](https://forum.kirupa.com/t/scrolling-movieclip-loop-within-set-area/293485/1 "2009-07-29T18:21:48Z")

</div>

I’ve got a movieClip that’s scrolling across the stage that loops nicely (kinda like the many cloud animations out there).

I’ve set the clip up to stop it’s scrolling on a rollOver, and start up again on the rollOut.

My problem is that after the rollOut the loop doesn’t work. The movieClip just keeps travelling. Can anyone help me in terms of the code? Tnx

```auto
 
blue.onEnterFrame = function() {
blue._x -= 2;
if (blue._x<=-0) {
blue._x = 864;
}
};
 
blue.onRollOver = function() {
delete blue.onEnterFrame;
};
 
 
blue.onRollOut = function(){blue.onEnterFrame=function(){
blue ._x-= 2;}
if (blue._x<=-0) {
blue._x = 864;
}
};

```
