Recipe 17.11. Stopping All SoundsProblemYou want to stop all sounds. SolutionUse the stopAllSounds( ) function. DiscussionRecipe 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. |
Tripod >> 3pod Tips & Learning and manuals for educations