有谁知道给flash 3.0动画加上播放、暂停、停止 控制按钮的代码吗?

2025-01-18 19:01:32
推荐回答(1个)
回答1:

var pp:Number=0;
play_btn.addEventListener(MouseEvent.MOUSE_DOWN,pla);
function pla(e:MouseEvent):void {
play_btn.mouseEnabled=false;

sc=snd.play(pp);
}

pause_btn.addEventListener(MouseEvent.MOUSE_DOWN,paus);
function paus(e:MouseEvent):void {
play_btn.mouseEnabled=true;
pp=sc.position;
sc.stop();
}

stop_btn.addEventListener(MouseEvent.MOUSE_DOWN,sto);
function sto(e:MouseEvent):void {
play_btn.mouseEnabled=true;
sc.stop();
pp=0;
}