Example
The following example creates a new Sound object called
and adjusts the volume on all sounds in the movie to 50%.
setVolume()
global_sound = new Sound();
global_sound.setVolume(50);
The following example creates a new Sound object, passes it the target movie clip
the
method, which starts any sound in
start
movie_sound = new Sound(my_mc);
movie_sound.start();
Sound.attachSound()
Availability
Flash Player 5.
Usage
my_sound.attachSound("idName")
Parameters
The identifier of an exported sound in the library. The identifier is located in the
idName
Linkage Properties dialog box.
Returns
Nothing.
Description
Method; attaches the sound specified in the
sound must be in the library of the current SWF file and specified for export in the Linkage
Properties dialog box. You must call
To make sure that the sound can be controlled from any scene in the SWF file, place the sound on
the main Timeline of the SWF file.
Sound.duration
Availability
Flash Player 6.
Usage
my_sound.duration
Description
Property (read-only); the duration of a sound, in milliseconds.
626
Chapter 12: ActionScript Dictionary
global_sound
.
my_mc
parameter to the specified Sound object. The
idName
to start playing the sound.
Sound.start()
. The second line calls
, and calls
my_mc
Need help?
Do you have a question about the FLASH MX 2004 - ACTIONSCRIPT and is the answer not in the manual?