# Non stop looping

**URL:** <https://forum.kirupa.com/t/non-stop-looping/303717>\
**Category:** flash\
**Created:** [January 25, 2010, 10:48pm UTC](https://forum.kirupa.com/t/non-stop-looping/303717 "2010-01-25T22:48:11Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![viper14](https://avatars.discourse-cdn.com/v4/letter/v/dc4da7/32.png) [@viper14](https://forum.kirupa.com/u/viper14)\
**Post date:** [January 25, 2010, 10:48pm UTC](https://forum.kirupa.com/t/non-stop-looping/303717/1 "2010-01-25T22:48:11Z")

</div>

hi im new here and new to flash and i have a problem. On frame 18 i hav a red circle moving from left to right and you have to shoot it. this works fine but when i click the button below to go to the next frame they keep going across the screen on frame 19. Here is the code im using. Thanks for your help.

Code:-

onClipEvent(load)

{

function reset()

{

```
   if(this._name=="face")

   {

       this._visible=false;

   }

   else

   {

       this._visible=true;

   }

   this.dead=0;

   this.speed=random(8)+3;

   this._x=600;

   this._y=random(400);

```

}

this.reset();

}

onClipEvent(enterFrame)

{

```
this._x-=this.speed;

if(this._x&lt;-40)

{

    this.reset();

}

```

}
