详细内容
flash课件制作播放器拖动进度条
flash课件制作播放器拖动进度条
//这是进度条的宽度:
w = 100;
Drag = false;
ball.onPress = function() {
if (_parent.Playing) {
Drag = true;
startDrag(this, false, 0, 0, w, 0);
}
};
function onMouseUp() {
if (Drag) {
//不知有没有像gotoAndPlay()的函数,就不用那么麻烦了:
_parent.mySound.stop();
_parent.mySound.start(ball._x/w*_parent.mySound.duration/1000, 1);
//----------------------------------------------------------
Drag = false;
stopDrag();
}
}
function onEnterFrame() {
if (_parent.Playing && Drag == false) {
ball._x = _parent.mySound.position/_parent.mySound.duration*w;
}
}