一般的全FLASH网站的背景音乐都是重复播放的,并可以中途暂停之后再继续播放
一开始发现soundChannel.position竟然大于sound.length
暂停时我是这样写的 soundChannel=sound.play(soundChannel.position,999)
发现从暂停过再继续播放以后。音乐文件是在继续重复播放,不过他重复的是从我点击暂停那个position开始一直循环,而不是从音乐的开头开始。
最后放弃 sound.play(0,999)方法
选择soundChannel.addEventListener(Event.SOUND_COMPLETE,onSoundPlayComplete)
private function onSoundPlayComplete(e:Event):void {
soundChannel = s.play(0);
soundChannel.removeEventListener(Event.SOUND_COMPLETE, onSoundPlayComplete)
soundChannel.addEventListener(Event.SOUND_COMPLETE,onSoundPlayComplete)
}
问题得以解决。。。。。。。。。。。。