我需要让我的音频播放器默认使用20%而不是100%开头。我试图扣除相关动作脚本中的一些数字,然后我所做的只是将整个水平线设置为20%...我什至试图将音量向后拉,但这不是它的工作方式。(顺便说一下,我不是编码人员。我只是玩代码来了解它们的工作原理)
我想这与下面的动作脚本有关,但是如果我错了,我还附加了源代码.fla ...
//
// SOUND CONTROL COMPONENT
//
// Initial Settings
//
originY = volBttn._y;
originX = volBttn._x;
maxX = scrollBar._width-volBttn._width;
eq_mc.gotoAndStop(Math.round(1+(_global.volumeAmount/20)));
hover_mc._visible = false;
// Equaliser
doEQ = function () {
eq_mc.eq_all._yscale = _global.volumeAmount;
};
resetSlider = function () {
volBttn._x = Math.round((scrollBar._width-volBttn._width)*(_global.volumeAmount/100));
};
// Volume button onPress
volBttn.onPress = function() {
this.startDrag(0, 0, originY, maxX, originY);
hover_mc.onEnterFrame = function() {
_global.volumeAmount = Math.round((volBttn._x/(scrollBar._width-volBttn._width))*100);
doEQ();
this.txt.text = _global.volumeAmount+"%";
this.txt._width = this.txt.textWidth+10;
this.bg._width = this.txt._width+10;
this._x = volBttn._x+volBttn._width/2;
this._y = volBttn._y;
hover_mc._visible = true;
};
};
// Volume button onRelease
volBttn.onRelease = volBttn.onReleaseOutside=function () {
delete hover_mc.onEnterFrame;
this.stopDrag();
hover_mc._visible = false;
this.gotoAndPlay('rollOut');
};
volBttn.onRollOver = function() {
this.gotoAndPlay('rollOver');
};
我也无法通过单击导航栏来增大或减小音量。我必须单击并按住该小导航器,然后将其向左或向右拖动。更不用说没有静音按钮了,这有点困难。我该如何解决?
我反编译了两个swf文件:index20.swf和index100.swf,但是您不是我的意思,因为在这两个文件中我都找到了:
...
// it's the 89th line of the 1st frame of your main timeline, here you should put 20
_global.volumeAmount = 100;
_global.volSaved = "";
...
因此,要使瑞士法郎根据需要工作,应设置:
_global.volumeAmount = 20;
然后,在soundControl_mc.volume_mc
MovieClip中,您必须执行resetSlider()
和doEQ()
函数以设置音量滑块的初始位置并初始化均衡器,如果您是在时间轴中soundControl_mc.volume_mc
或在_global.volumeAmount
主时间轴中进行设置之后,则应在它们的定义之后调用它们:
resetSlider();
doEQ();
这会给你这样的东西:
您可以在此处下载您的项目。
希望能对您有所帮助。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句