S > Sound (object)

Sound (object)

The Sound object allows you to set and control sounds in a particular movie clip instance, or for the global Timeline, if you do not specify a target when creating a new sound object. 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 only supported for the Flash 5 Player.


 
Method summary for the Sound object
Method Description

attachSound

Attaches the sound specified in the argument.

getPan

Returns the value of the previous setPan call.

getTransform

Returns the value of the previous setTransform call.

getVolume

Returns the value of the previous setVolume call.

setPan

Sets the left/right balance of the sound.

setTransform

Sets transform for a sound.

setVolume

Sets the volume level for a sound.

start

Starts playing a sound from the beginning or, optionally, from an offset point set in the argument.

stop

Stops the specified sound or all sounds currently playing.



 
Constructor for the Sound object

Syntax

new Sound();
new Sound(target);

Arguments

target The movie clip instance that the Sound object applies to. This argument is optional.

Description

Method; creates a new Sound object for a specified movie clip. If you do not specify a target, the Sound object controls all of the sounds in the global Timeline.

Player

Flash 5 or later.

Example

GlobalSound = new Sound();
MovieSound = new Sound(mymovie);