【发布时间】:2010-11-25 15:10:04
【问题描述】:
在完全下载 mp3 之前,我怎样才能找到它的总时间?我有这个在 TimerEvent.TIMER 上调用的函数
private function onTick(e:TimerEvent):void
{
_soundLength = _sound.length;
_position = _channel.position;
mp3Interface.timeBar.timers.elapsedTime.text = ascb.util.DateFormat.formatMilliseconds(_position);
mp3Interface.timeBar.timers.totalTime.text = ascb.util.DateFormat.formatMilliseconds(_soundLength);
var percentPlayed:Number = Math.round((_position/_soundLength)*100);
mp3Interface.timeBar.seeker.x = (percentPlayed*mp3Interface.timeBar.progressBar.width-5)/100;
}
问题是只有当 mp3 完全下载时,totalTime 才是正确的..
【问题讨论】: