Need help controlling the amount of bullets

I cant figure out how decrease or control the amount of bullets in this actionscript when some click on the mouse, otherwise it is constant stream of bullets when a user clicks fast enough. If there is another script giving me the ability to shoot projectiles out of barrel that movies at a angle controlled by a cross air

Mouse.hide();
var speed:Number = 10;
var depth:Number = 1;
var nose:Number = 95;
_root.onMouseMove = function() {
updateAfterEvent();
var xdiff:Number = _root._xmouse-gun._x;
var ydiff:Number = _root._ymouse-gun._y;
var angle:Number = Math.atan2(ydiff, xdiff);
angle = angle180/Math.PI;
gun._rotation = angle;
};
_root.onMouseDown = function() {
var angle:Number = gun._rotation;
angle = angle
Math.PI/180;
++depth;
var name:String = “projectile”+depth;
var clip:MovieClip = _root.attachMovie(“projectile”, name, depth);
clip._x = gun._x+noseMath.cos(angle);
clip._y = gun._y+nose
Math.sin(angle);
clip.xmov = speedMath.cos(angle);
clip.ymov = speed
Math.sin(angle);
clip.onEnterFrame = function() {
this._x += this.xmov;
this._y += this.ymov;
};
};