Bullet deletion

i have a game where various things can fire. the problem is, is that when the game moves on i.e you complete the level or you die, the bullets that were on the stage when you died stay on the stage in a frozen position and i dont know how to get rid of them.
the game file is at

http://www.freewebs.com/shlar/lnsg.fla

the code for firing is:


[COLOR=red]onClipEvent (load) {
 sr_bullets = 0;
 srot = 0;
 sListener = new Object();
}
[/COLOR][COLOR=slategray]onClipEvent (enterFrame) {
 sListener.onKeyDown = function() {
  if (Key.isDown(Key.SPACE)) {
   sr_bullets++;
   new_sname = "sand"+sr_bullets;
   duplicateMovieClip(_root.sand0, new_sname, sr_bullets);
   _root[new_sname]._x = _root.char._x;
   _root[new_sname]._y = _root.char._y;
   _root[new_sname]._rotation = _root.charhelp._rotation;
  }
 };
 Key.addListener(sListener);
 onEnterFrame = function () {
  for (i=1; i<=sr_bullets; i++) {
   srot = _root["sand"+i]._rotation;
   _root["sand"+i]._y -= 10*Math.cos(srot*(Math.PI/180));
   _root["sand"+i]._x += 10*Math.sin(srot*(Math.PI/180));[/COLOR]
[COLOR=blue] if (_root["sand"+i].hitTest(_root.enemy1)) {
    _root["sand"+i].removeMovieClip();
    _root.enemy1.gotoAndStop(15);
   }
   if (_root["sand"+i].hitTest(_root.enemy2)) {
    _root["sand"+i].removeMovieClip();
    _root.enemy2.gotoAndStop(15);
   }
   if (_root["sand"+i].hitTest(_root.left)) {
    _root["sand"+i].removeMovieClip();
   }
   if (_root["sand"+i].hitTest(_root.leftt)) {
    _root["sand"+i].removeMovieClip();
   }
   if (_root["sand"+i].hitTest(_root.left56)) {
    _root["sand"+i].removeMovieClip();
   }
   if (_root["sand"+i].hitTest(_root.leftu)) {
    _root["sand"+i].removeMovieClip();
   }
   if (_root["sand"+i].hitTest(_root.up)) {
    _root["sand"+i].removeMovieClip();
   }
   if (_root["sand"+i].hitTest(_root.up1)) {
    _root["sand"+i].removeMovieClip();
   }
   if (_root["sand"+i].hitTest(_root.up2)) {
    _root["sand"+i].removeMovieClip();
   }
   if (_root["sand"+i].hitTest(_root.upu)) {
    _root["sand"+i].removeMovieClip();
   }
   if (_root["sand"+i].hitTest(_root.upz)) {
    _root["sand"+i].removeMovieClip();
   }
   if (_root["sand"+i].hitTest(_root.up56)) {
    _root["sand"+i].removeMovieClip();
   }
   if (_root["sand"+i].hitTest(_root.down)) {
    _root["sand"+i].removeMovieClip();
   }
   if (_root["sand"+i].hitTest(_root.down1)) {
    _root["sand"+i].removeMovieClip();
   }
   if (_root["sand"+i].hitTest(_root.down2)) {
    _root["sand"+i].removeMovieClip();
   }
   if (_root["sand"+i].hitTest(_root.down3)) {
    _root["sand"+i].removeMovieClip();
   }
   if (_root["sand"+i].hitTest(_root.down56)) {
    _root["sand"+i].removeMovieClip();
   }
   if (_root["sand"+i].hitTest(_root.right)) {
    _root["sand"+i].removeMovieClip();
   }
   if (_root["sand"+i].hitTest(_root.rightt)) {
    _root["sand"+i].removeMovieClip();
   }
   if (_root["sand"+i].hitTest(_root.right3)) {
    _root["sand"+i].removeMovieClip();
   }
   if (_root["sand"+i].hitTest(_root.rightu)) {
    _root["sand"+i].removeMovieClip();
   }
  }[/COLOR]
 };
}

the if’s are just when the bullet hits the walls ect.

but when the character dies and gos to the next frame the bullets still stay on the stage and ive tried code to get them off the stage but they wont go. i have tried this code on the “dead” frame


[COLOR=magenta]onEnterFrame[/COLOR] = [COLOR=royalblue]function () {[/COLOR]
[COLOR=seagreen]_root[/COLOR]["[COLOR=blue]sand[/COLOR]"+i].[COLOR=red]removeMovieClip();[/COLOR]
[COLOR=seagreen]_root[/COLOR]["[COLOR=blue]bullet[/COLOR]"+i].[COLOR=red]removeMovieClip();[/COLOR]
[COLOR=seagreen]_root[/COLOR]["[COLOR=blue]sand[/COLOR]"+i]._x = 932048;
[COLOR=seagreen]_root[/COLOR]["[COLOR=blue]bullet[/COLOR]"+i]._x = 45784;
 [COLOR=darkorange]for[/COLOR] (i=1; i<=[COLOR=pink]sr_bullets[/COLOR]; i++) {
 [COLOR=seagreen] _root[/COLOR]["[COLOR=blue]sand[/COLOR]"+i].[COLOR=red]removeMovieClip();[/COLOR]
 [COLOR=seagreen] _root[/COLOR]["[COLOR=blue]sand[/COLOR]"+i]._x = 932048;
 }
[COLOR=darkorange]for[/COLOR] (i=1; i<=[COLOR=pink]nr_bullet[/COLOR]; i++) {
  [COLOR=seagreen]_root[/COLOR]["[COLOR=blue]bullet[/COLOR]"+i].[COLOR=red]removeMovieClip();[/COLOR]
  [COLOR=seagreen]_root[/COLOR]["[COLOR=blue]bullet[/COLOR]"+i]._x = 45784;
 }
};

any help is appreciated

thanks

Just write some code saying something like:

If (levelOver == true)
{

for (BulletCount = 0; BulletCount > 21; BulletCount++)
{
this.removeMovieClip();
}
}

thats what ive been trying and it dosnt work

ive edited it a little. this cod i have on a frame and i want all of the bullets to delet but it still isnt working


for (i=1; i<=nr_bullet, i<=sr_bullets; i++) {
 onEnterFrame = function () {
  _root["bullet"+i].enabled = false;
  _root["bullet"+i].removeMovieClip();
  _root["sand"+i].enabled = false;
  _root["sand"+i].removeMovieClip();
 };
}