Stopping sound in a more efficient way?

Hi,

I am currently working with student creating flash project and when they use sound on a page they declare an instance of a sound channel with a variable name i.e. SC1, SC2 etc for each song needed. At the moment to stop all the sounds when a user presses a navigation button rather than the stop button first, im adding the code SC1.stop(); SC2.stop(); etc onto each button event. If a student has a number of songs on one page and a number of navigation buttons to move away from the page is there an easier way to stop any and all sound channels when any button is pressed than could be declared just once on each page rather than using the same code in a number of different events on the same script.  

Thanks
Regards
Karl
Karl01Asked:
Who is Participating?
 
deepanjandasConnect With a Mentor Commented:
Try this:

import flash.media.SoundMixer;
SoundMixer.stopAll();

Warm Regards
Deepanjan Das
0
 
Karl01Author Commented:
Excellent solution.

Thank you very much
Karl
0
All Courses

From novice to tech pro — start learning today.