removeMovieClip(this);
_____

stop();

maxTarget = 10;
totalScore = 0;
totalTarget = 1000;

targetCount = 0;
targets = 0;

_root.attachMovie("aim","aim",10000);
_root.attachMovie("hit","hit",10001);

onEnterFrame = function () {
    Mouse.hide();
    hit._x = aim._x=_xmouse;
    hit._y = aim._y=_ymouse;
    if (_root.ammoCounter._currentframe>=10) {
        gotoAndStop(2);
    }
    if (maxTarget>targetCount and totalTarget>0) {
        if (random(50) == 0) {
            target.duplicateMovieClip("target"+targets,targets++);
            targetCount++;
            totalTarget--;
        }
    }
};
onMouseDown = function () {
    gunShot();
};

shot = new Sound();
shot.attachSound("shot");
shot.setVolume(5);

dead = new Sound();
dead.attachSound("dead");

function gunShot() {
    shot.start(0,1);
}

function deadSound() {
    dead.start(0,1);
}

__________

onClipEvent (load) {
    if (_name != "target") {
        speed = 2;
        score = 100;

        //--------> DO NOT CHANGE ANYTHING BELOW <---------//
        num = _root.targets;
        left_border = 0;
        right_border = Stage.width;
        top_border = 0;
        bottom_border = 300;
        direction = (random(2)*2)-1;
        xspeed = speed*direction;
        _xscale = -100*direction;
        direction>0 ? _x=-_width : _x=Stage.width+_width;
        _y = random(bottom_border-_height)+_height;
    }
}

onClipEvent (enterFrame) {
    if (_name != "target") {
        _x += xspeed;
        if (_x>right_border+_width/2 and direction>0) {
            _root.targetCount--;
            removeMovieClip(this);
            _root.ammoCounter.nextFrame();
        }
        if (_x<left_border-_width/2 and direction<0) {
            _root.targetCount--;
            removeMovieClip(this);
            _root.ammoCounter.nextFrame();
        }
    }
}
onClipEvent(mouseDown){
    if(this.hitTest(_root.hit)){
        _root.deadSound();
        _root.totalScore += score;
        _root.targetdead.duplicateMovieClip("targetdead"+num, _root.getNextHighestDepth());
        _root["targetdead"+num]._x = _x;
        _root["targetdead"+num]._y = _y;
        _root.targetCount--;
        removeMovieClip(this);
    }
}
________________________

on(release){
    _root.prevFrame();
}