播放器拖动进度条制作

王朝other·作者佚名  2008-05-19
窄屏简体版  字體: |||超大  

草草做了个,有些小问题,不过基本上实现楼主的想法,嗯...这些天老是觉得时间不够用,又要上课又要玩游戏...这是进度条的代码:

//这是进度条的宽度:

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;

}

}

 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
 
 
© 2005- 王朝網路 版權所有 導航