|
Sound (object)
The Sound object lets you control sound in a movie. You can add sounds to a movie clip from the Library while the movie is playing and control those sounds. If you do not specify a target when you create a new Sound object, you can use the methods to control sound for the whole movie. You must use the constructor new Sound to create an instance of the Sound object before calling the methods of the Sound object.
The Sound object is supported in Flash Player 5 and Flash Player 6.
Note: The Macromedia Flash Player 6r40 and later supports MP3 files with ID3 v1.0 and v1.1 tags. See "Accessing ID3 properties in MP3 files with the Flash Player" in Flash Help (Help > Using Flash > Adding Sound).
Method summary for the Sound object
Property summary for the Sound object
Event handler summary for the Sound object
Constructor for the Sound object
Availability
Flash Player 5.
Usage
new Sound([ target ])
Parameters
target The movie clip instance on which the Sound object operates. This parameter is optional.
Returns
Nothing.
Description
Constructor; creates a new Sound object for a specified movie clip. If you do not specify a target instance, the Sound object controls all of the sounds in the movie.
Example
The following example creates a new instance of the Sound object called GlobalSound . The second line calls the setVolume method and adjusts the volume on all sounds in the movie to 50%.
globalsound = new Sound();
globalsound.setVolume(50);
The following example creates a new instance of the Sound object, passes it the target movie clip myMovie , and calls the start method, which starts any sound in myMovie .
moviesound = new Sound( myMovie );
moviesound.start();
|