_soundbuftime
Availability
Flash Player 4.
Usage
_soundbuftime:Number = integer
Parameters
The number of seconds before the SWF file starts to stream.
integer
Description
Property (global); establishes the number of seconds of streaming sound to buffer. The default
value is 5 seconds.
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
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);
property is set to buffer the MP3 for 10 seconds. A new Sound object instance is
CHAPTER 7
ActionScript for Flash
_soundbuftime
703
Need help?
Do you have a question about the FLEX-FLEX ACTIONSCRIPT LANGUAGE and is the answer not in the manual?