Flash CS3 Documentation |
|||
| Flash Lite 2.x ActionScript Language Reference > ActionScript classes > Sound > loadSound (Sound.loadSound method) | |||
Loads an MP3 file into a Sound object. You can use the isStreaming parameter to indicate whether the sound is an event or a streaming sound.
Event sounds are completely loaded before they play. They are managed by the ActionScript Sound class and respond to all methods and properties of this class.
Streaming sounds play while they are downloading. Playback begins when sufficient data is received to start the decompressor.
All MP3s (event or streaming) loaded with this method are saved in the browser's file cache on the user's system.
Note: For Flash Lite 2.0, you can ignore the isStreaming parameter because Flash Lite 2.0 treats every sound as an event sound.
url:String - The location on a server of an MP3 sound file.
isStreaming:Boolean - A Boolean value that indicates whether the sound is a streaming sound (true) or an event sound (false).
The following example loads an event sound, which cannot play until it is fully loaded:
var my_sound:Sound = new Sound();
my_sound.loadSound("song1.mp3", false);
The following example loads a streaming sound:
var my_sound:Sound = new Sound();
my_sound.loadSound("song1.mp3", true);
Flash CS3
Send me an e-mail when comments are added to this page | Comment Report
Current page: http://livedocs.adobe.com/flash/9.0/main/00005430.html