all groups > flash (macromedia) > august 2005 >
You're in the

flash (macromedia)

group:

Pump of the Volume


Pump of the Volume ronchicago
8/31/2005 11:39:11 PM
flash (macromedia):
Trying to get a new fader to work. I can make the fader "fader - gain" in the
common library work but i made a custom fader which is horizontal and starts in
the middle. I can't figure out the end of the horizontal code I think. could
use some help. here are the codes.


VERTICAL FADER - GAIN (note, i can successfully installed this fader from the
common library)
code starts off...

top = vol._y;
left = vol._x;
right = vol._x;
bottom = vol._y+100;
level = 100;

finally script ends like this. note: i have a sound instance named
"site_sound" ...

this.onEnterFrame = function() {
if (dragging) {
level = 100-(vol._y-top);
} else {
if (level>100) {
level = 100;
} else if (level<0) {
level = 0;
} else {
vol._y = -level+100+top;
}
}
_root.site_sound.setVolume(level);
};


HORIZONTAL FADER - MIXER (note: button starts in center = 50% go to left = 0%
go to right = 100%

code starts off...

top = vol._y;
bottom = vol._y;
left = vol._x-50;
right = vol._x+50;
level = 100;

how do i write the ending? can't get it to work...

thank you!
Re: Pump of the Volume ronchicago
9/1/2005 12:00:00 AM
Getting closer! everything works BUT the volume increase = 100% on left, 0% on
right. anyone want to take a stab at this?

here is the code to date...

top = vol._y;
left = vol._x-50;
right = vol._x+50;
bottom = vol._y;
level = 50;
//
vol.onPress = function() {
startDrag("vol", false, left, top, right, bottom);
dragging = true;
};
vol.onRelease = function() {
stopDrag();
dragging = false;
};
vol.onReleaseOutside = function() {
dragging = false;
};
//
this.onEnterFrame = function() {
if (dragging) {
level = 100-(vol._x-left);
} else {
if (level>100) {
level = 100;
} else if (level<0) {
level = 0;
} else {
vol._x = -level+100+left;
}
}
_root.site_sound.setVolume(level);
};


thank you!

r


Re: Pump of the Volume ronchicago
9/2/2005 7:40:30 PM
This code works when I flipped the fader 180'. I don't know if it that is kosher but it now looks and works like it is supposed to.

AddThis Social Bookmark Button