loadSound (Sound.loadSound method)

public loadSound(url:String, isStreaming:Boolean) : Void

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 has been 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.

When using this method, consider the Flash Player security model.

For Flash Player 8:

For Flash Player 7 and later:

For more information, see the following:

Availability: ActionScript 1.0; Flash Player 6

Parameters

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).

Example

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);

See also

onLoad (Sound.onLoad handler)


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/00002135.html