Flash AS2 one sound at a time

387 Views Asked by At

i'm creating a soundboard in Flash AS2, and i need that only one sound plays at a time, so if i play button 1, and then press button 2, button 1 sound stops and i listen to button 2 only. i'm making a test with 6 buttons, all of them in the same frame. i've found many answers responding that i would need to use on (press) {stopAllSounds () ; } on each button. so i did that, but now all sounds, including the one i'm trying to play, are stopped. so i end up hearing nothing. any ideas on how to solve this? thanks.

2

There are 2 best solutions below

0
AdamXpelled On BEST ANSWER

got the answer! just put this code on the frame where your sounds are located:

onMouseDown = function () {
stopAllSounds(); };

done.

3
Álvaro Touzón On

Put one sound into a timeline to one movieclip. And use stop and play. So to stopAll but not current use an array wich content all movieclip sound avbove defined.