var snd:Sound = new Sound();
var t:Timer = new Timer(100);
var sndChannel:SoundChannel;
snd.addEventListener(Event.COMPLETE,onComplete);
t.addEventListener(TimerEvent.TIMER,onTimer);
snd.load(new URLRequest('some.mp3'));
function onComplete(e:Event):void
{
sndChannel = snd.play();
t.start();
sndChannel.addEventListener(Event.SOUND_COMPLETE,onSndComplete);
}
function onTimer(e:TimerEvent):void
{
trace(sndChannel.position/snd.length); // less than 1
}
function onSndComplete(e:Event):void
{
trace(sndChannel.position/snd.length); // also less than 1
}
/ - 谁能告诉我为什么'sndChannel.position/snd.length'总是小于1?这是一个错误吗?如何修复这个错误?谢谢... - /