Actionscript3 play multiple sounds
I am writing a simple Flash space-shooter-type game. Every time the player fires or an enemy is shot I play a sound. The problem is sound appear to be "blocking" - if the player shoots very often (i.e. before previous sound has finished) the new sound will not play until the previous one has finished. Here is my code:
//constructor- pre-load all sounds
fireSound = new Sound();
var req:URLRequest = new URLRequest("fire.mp3");
fireSound.load(req);
//enter frame listener- play sound
//if space b开发者_开发百科ar pressed
fireSound.play();
//if enemy shot
otherSound.play();
精彩评论