Possible way to stop music using JavaScript
Hello,
I need to stop audio in some Flash Files. Is it possible way to stop music using JavaScript? Please can you guide me to stop unwanted music on my files?
Hello,
I need to stop audio in some Flash Files. Is it possible way to stop music using JavaScript? Please can you guide me to stop unwanted music on my files?
Hi,
In your Flash File there is a function:
stopSound():void {SoundMixer.stop();}.
You can make it available for JavaScript calls:
ExternalInterface.addCallback('stopSound', stopSound);
In your JavaScript code you will be having this simple function that selects your swf:
Function getFlashMovie(movieName)
{var isIE = navigator.appName.indexOf("Microsoft") != -1; return (isIE) ? Window[movieName] : Document[movieName];}
If you want to stop the sound in your movie, call the function you've previously made available in the swf, from JavaScript:
Movie = getFlashMovie('your-movie-name');movie.stopSound();
Â