This might work. I haven't tested it. But it should give you some idea.
On frame one:
On each subsequent frame:Code:var isPlaying = false; var sndFx = new Sound(this); sndFx.attachSound("linkageNameOfYourSound"); sndFx.onSoundComplete = function() { isPlaying = false; } function playSndFx() { sndFx.start(); isPlaying = true; } playSndFx();
Or try writing a function that does does the typing and called by setInterval. So everytime the function executes you play the sound.Code:if(!isPlaying) { playSndFx(); }




Reply With Quote