草草做了个,有些小问题,不过基本上实现楼主的想法,嗯...这些天老是觉得时间不够用,又要上课又要玩游戏...这是进度条的代码:
//这是进度条的宽度:
w=100;
Drag=false;
ball.onPress=function(){
if(_parent.Playing){
Drag=true;
startDrag(this,false,0,0,w,0);
}
};
functiononMouseUp(){
if(Drag){
//不知有没有像gotoAndPlay()的函数,就不用那么麻烦了:
_parent.mySound.stop();
_parent.mySound.start(ball._x/w*_parent.mySound.duration/1000,1);
//----------------------------------------------------------
Drag=false;
stopDrag();
}
}
functiononEnterFrame(){
if(_parent.Playing&&Drag==false){
ball._x=_parent.mySound.position/_parent.mySound.duration*w;
}
}