Sound.stop()
Availability
Flash Player 5.
Usage
my_sound.stop(["idName":String]) : Void
Parameters
An optional parameter specifying a specific sound to stop playing. The
idName
parameter must be enclosed in quotation marks (" ").
Returns
Nothing.
Description
Method; stops all sounds currently playing if no parameter is specified, or just the sound specified
in the
parameter.
idName
Example
The following example uses two buttons,
sound that loads into a SWF file. Add two buttons to your document and add the following
ActionScript to your FLA or AS file:
var my_sound:Sound = new Sound();
my_sound.loadSound("song1.mp3", true);
stop_btn.onRelease = function() {
trace("sound stopped");
my_sound.stop();
};
play_btn.onRelease = function() {
trace("sound started");
my_sound.start();
};
See also
Sound.start()
and
stop_btn
play_btn
idName
, to control the playback of a
Sound.stop()
775
Need help?
Do you have a question about the FLASH MX 2004-ACTIONSCRIPT LANGUAGE and is the answer not in the manual?
Questions and answers