Actionscript 3 检查歌曲是否在AS3中缓冲
我有以下代码:Actionscript 3 检查歌曲是否在AS3中缓冲,actionscript-3,audio,buffer,Actionscript 3,Audio,Buffer,我有以下代码: 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(); } 现在我希望能够检查歌曲是否缓冲。有
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();
}
现在我希望能够检查歌曲是否缓冲。有办法做到这一点吗?还是我应该换一种方式 似乎可以使用声音对象的属性
也许您可以使用计时器或Event.EnterFrame侦听器定期检查,只要声音尚未完全下载(即直到Event.COMPLETE触发)。在这一点之后,出于明显的原因,检查
isBuffering
,以便删除计时器或EnterFrame是没有意义的。我不敢相信我忽略了这个属性。谢谢!