Flash CS3 Documentation |
|||
| Flash Lite 2.x ActionScript Language Reference > ActionScript classes > Sound > stop (Sound.stop method) | |||
public stop([linkageID:String]) : Void
Stops all sounds currently playing if no parameter is specified, or just the sound specified in the idName parameter.
linkageID:String [optional] - A parameter specifying a specific sound to stop playing. The idName parameter must be enclosed in quotation marks (" ").
The following example uses two buttons, stop_btn and play_btn, to control the playback of a 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();
};
Flash CS3
Send me an e-mail when comments are added to this page | Comment Report
Current page: http://livedocs.adobe.com/flash/9.0/main/00005440.html