Fire Rate?

Hello,
I can’t figure out which way to go to have a good firing from a weapon with a rate of fire…
I have a hero class where i have, inside an onEnterFrame function :


if (Key.isDown(Key.SPACE) && fireInterval == false) {
			var myInt = setInterval(this.launchMissile(), this.missileRate);
			fireInterval = true;
		}
		if (!Key.isDown(Key.SPACE)) {
			clearInterval(myInt);
			fireInterval = false;
		}

the launchMissile function is a simple attachMovie function.
Now for some reason, even if i hold the space key down, the interval isn’t working… Help :smiley: