
Sound.loadSound() Method
This is the Title of the Book, eMatter Edition
Copyright © 2007 O’Reilly & Associates, Inc. All rights reserved.
780
|
ActionScript Language Reference
// If the sound loaded properly...
if (success = = true) {
// ...repeatedly check for a valid duration.
var intID = setInterval(pollForDuration, 100);
}
}
// Load the MP3 file
song.loadSound("track1.mp3", false);
See Also
capabilities.hasMP3, Sound.loadSound(), Sound.onLoad()
Sound.loadSound() Method
download an external sound file into the Player
Flash 6
soundObject.loadSound(url, isStreaming)
Arguments
url A string specifying the network or local path of the sound file to load.
isStreaming A Boolean specifying the type of sound to load: either streaming (
true)or
event (
false).
Description
The loadSound() method loads an external sound file from url. In Flash 6, only MP3 files
can be loaded via loadSound().If
isStreaming is true, the loaded sound will behave as a
streaming sound and will automatically begin playback as soon as the required buffer has
loaded (see the global
_soundbuftime property). If isStreaming is false, the loaded sound
will behave as an event sound and will not begin playing automatically. To play a loaded
event sound, use Sound.start() after the sound has fully loaded (see the following Example).
To stop the playback of a loaded sound (either streaming or event), use Sound.stop().In
versions of the Flash Player ...