_soundbuftime property

_soundbuftime:Number = integer

Establishes the number of seconds of streaming sound to buffer. The default value is 5 seconds.

Availability: ActionScript 1.0; Flash Player 4

Parameters

integer:Number - The number of seconds before the SWF file starts to stream.

Example

The following example streams an MP3 file and buffers the sound before it plays for the user. Two text fields are created at runtime to hold a timer and debugging information. The _soundbuftime property is set to buffer the MP3 for 10 seconds. A new Sound object instance is created for the MP3.

// create text fields to hold debug information.
this.createTextField("counter_txt", this.getNextHighestDepth(), 0, 0, 100, 22);
this.createTextField("debug_txt", this.getNextHighestDepth(), 0, 20, 100, 22);
// set the sound buffer to 10 seconds.
_soundbuftime = 10;
// create the new sound object instance.
var bg_sound:Sound = new Sound();
// load the MP3 sound file and set streaming to true.
bg_sound.loadSound("yourSound.mp3", true);
// function is triggered when the song finishes loading.
bg_sound.onLoad = function() {
 debug_txt.text = "sound loaded";
};
debug_txt.text = "sound init";
function updateCounter() {
 counter_txt.text++;
}
counter_txt.text = 0;
setInterval(updateCounter, 1000);

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