views:

24

answers:

1

I have the following piece of code:

var song:Sound;
var sndChannel:SoundChannel;
var context:SoundLoaderContext = new SoundLoaderContext(2000);

function songLoad():void {
    song.load(new URLRequest(songs[selected]),context);
    sndChannel = song.play();
}

Now I want to be able to check if the song is buffering or not. Is there a way to do this? Or should I approach it differently?
Thanks in advance!

A: 

Seems like you could use the isBuffering property of the Sound object.

Maybe you could check it periodically with a Timer or an Event.EnterFrame listener, as long as the sound has not been completely downloaded (i.e. until Event.COMPLETE fires). After that point, it makes no sense to check isBuffering, for obvious reasons, so you could remove the Timer or EnterFrame.

Juan Pablo Califano
I can't believe I overlooked that property. Thanks a lot!
SXMC