April 2006
Beginner
544 pages
14h 51m
English
You want to stop all sounds.
Use the stopAllSounds( ) function.
Recipe 17.10 shows you how to stop individual sounds. You can also stop all sounds using the stopAllSounds( ) function. When this function is invoked, all sounds that are playing are immediately stopped. It doesn’t matter if the sounds were started with a button or from the playhead entering a timeline keyframe.
stopAllSounds();
If you want to use a button to stop all sounds, you can place the function call within an event handler method.
btn.onRelease = function() {
stopAllSounds();
}Or, if you want to stop all the sounds when the playhead enters a certain frame, you can add the function to that keyframe.
Read now
Unlock full access