flash语句问题

来源:百度知道 编辑:UC知道 时间:2024/09/25 01:22:56
一个控制声音音量的按钮,按钮中的语句如下:
var snd = 70;
if (_root.default_volume == undefined) {
xx = snd;
} else {
xx = _root.default_volume;
}
xx = (xx*70)/100+21;
if (xx>91) {
btn._x = 91;
} else {
btn._x = xx;
}
bar.bg._width = btn._x-21;
snd = Math.ceil((btn._x-21)*100/71);
volume_mc.volume_txt.text = snd;
my_sound.setVolume(snd);
var ctrl = 1;
var info = new Array();
my_sound = new Sound();
my_sound.setVolume(snd);
btn.onPress = function() {
startDrag(btn, false, 21, 5, 92, 5);
bar.onEnterFrame = function() {
this.bg._width = btn._x-21;
snd = Math.ceil((btn._x-21)*100/71);
volume_mc.volume_txt.text = snd;
my_sound.setVolume(snd);
};
};
btn.onRelease = btn.onReleaseOutside=function () {
delete bar.onEnterFrame;
stopDrag();
};
bar.onPress = function() {
if (_xmouse>92) {
btn._x = 92;
} else {<

btn这个应该是音量的位置那个钮,可以拖动的

icon_btn 这个不知道是啥 但它可以接受鼠标移过和移出的事件

移过的时候 某个东西的透明度变成90%

移出的时候 还是这个东西的透明度变成50%

this 就是这个会变透明度的东西 如果this是按钮的话
只要设置 this._x=787 this._y = 188就可以了
如果不是的话.......

icon_btn至少有两个帧 当他在第一帧的时候 btn可以使用
当他在第2帧的时候 btn不能使用

大概就是这么个意思吧 希望对你有所帮助