Possible way to stop music using JavaScript

Asked By 0 points N/A Posted on -


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?

Answered By 0 points N/A #171853

Possible way to stop music using JavaScript



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();


Login/Register to Answer

Related Questions