EasyManua.ls Logo

MACROMEDIA FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE - Stop (Sound.stop Method)

MACROMEDIA FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE
1378 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Sound 1117
The MovieClip.getNextHighestDepth() method used in this example requires Flash Player
7 or later. If your SWF file includes a version 2 component, use the version 2 components
DepthManager class instead of the
MovieClip.getNextHighestDepth() method.
See also
stop (Sound.stop method)
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.
Availability: ActionScript 1.0; Flash Player 5
Parameters
linkageID:String [optional] - A parameter specifying a specific sound to stop playing. The
idName parameter must be enclosed in quotation marks (" ").
Example
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();
};
See also
start (Sound.start method)

Table of Contents

Related product manuals