アニメーションのサウンドを制御するために割り当てられた1つの再開(onBtn)と1つの一時停止(offBtn)があります..一時停止ボタンは正常に機能しますが、もう一度再生すると...最初から曲を再開し、オンではありませんそれはresumeTimeだと思います...ここに私のコードがあります...
import flash.events.Event;
import flash.events.MouseEvent;
onBtn.addEventListener(MouseEvent.CLICK, startMove);
offBtn.addEventListener(MouseEvent.CLICK, stopMove);
var resumeTime:Number = 0;
var isPlaying:Boolean;
var mySound:Sound = new MySong();
var channel1:SoundChannel = new SoundChannel();
onBtn.visible=false;
isPlaying=true;
channel1=mySound.play();
function stopMove(event:MouseEvent):void {
resumeTime=channel1.position;
channel1.stop();
onBtn.visible =true;
offBtn.visible=false;
isPlaying=false;
stop();
}
function startMove(event:MouseEvent):void {
channel1=mySound.play(resumeTime);
onBtn.visible=false;
offBtn.visible=true;
isPlaying=true;
play();
}