Object | +-Sound public class Sound extends Object
The Sound class 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 a Sound object before calling the methods of the Sound class.
|
Modifiers |
Property |
Description |
|---|---|---|
|
|
The duration of a sound, in milliseconds. |
|
|
|
Provides access to the metadata that is part of an MP3 file. |
|
|
|
The number of milliseconds a sound has been playing. |
Properties inherited from class Object
|
constructor (Object.constructor property), __proto__ (Object.__proto__ property), prototype (Object.prototype property), __resolve (Object.__resolve property) |
|
Event |
Description |
|---|---|
|
onID3 = function() {} |
Invoked each time new ID3 data is available for an MP3 file that you load using Sound.attachSound() or Sound.loadSound(). |
|
Invoked automatically when a sound loads. |
|
|
onSoundComplete = function() {} |
Invoked automatically when a sound finishes playing. |
|
Signature |
Description |
|---|---|
|
Creates a new Sound object for a specified movie clip. |
|
Modifiers |
Signature |
Description |
|---|---|---|
|
|
attachSound(id:String) : Void |
Attaches the sound specified in the id parameter to the specified Sound object. |
|
|
getBytesLoaded() : Number |
Returns the number of bytes loaded (streamed) for the specified Sound object. |
|
|
getBytesTotal() : Number |
Returns the size, in bytes, of the specified Sound object. |
|
|
Returns the pan level set in the last setPan() call as an integer from -100 (left) to +100 (right). |
|
|
|
getTransform() : Object |
Returns the sound transform information for the specified Sound object set with the last Sound.setTransform() call. |
|
|
Returns the sound volume level as an integer from 0 to 100, where 0 is off and 100 is full volume. |
|
|
|
Loads an MP3 file into a Sound object. |
|
|
|
Determines how the sound is played in the left and right channels (speakers). |
|
|
|
setTransform(transformObject:Object) : Void |
Sets the sound transform (or balance) information, for a Sound object. |
|
|
Sets the volume for the Sound object. |
|
|
|
Starts playing the last attached sound from the beginning if no parameter is specified, or starting at the point in the sound specified by the secondOffset parameter. |
|
|
|
Stops all sounds currently playing if no parameter is specified, or just the sound specified in the idName parameter. |
Methods inherited from class Object