Groups | Blog | Home
all groups > flash actionscript > january 2006 >

flash actionscript : Sound.onLoad for streaming sounds


lindsayvine
1/25/2006 9:37:17 PM
If I load a streaming sound :

new_sound = new Sound( _root )
new_sound.loadSound( "sound.mp3" , true )

And then I specify an onLoad handler :

new_sound.onLoad = function() { .. }

When will the function be called?

Will it be called (a) when the sound has buffered enough to be played or (b)
when the sound has loaded completely?

And if the answer is (b), which i think i its, then is there a way for me to
detect when the sound has buffered enough to be played?

kglad
1/25/2006 11:42:22 PM
kglad
1/28/2006 2:32:14 AM
first, you won't be streaming your sound or you can't control when it starts.

you can compute the users download speed and use that to predict how long it
will take to dl your entire sound. and because you can determine the duration
of your sound you can calculate when to start your sound so the total download
will occur no later than your sounds duration.
AddThis Social Bookmark Button