Groups | Blog | Home
all groups > flash actionscript > august 2005 >

flash actionscript : Can anyone tell me that how could i controll the volume of a particular sound?


NSurveyor
8/18/2005 12:00:00 AM
You are using:

new Sound(this);

You probably used the same target clip in another new Sound(); Just create an
empty clip, and use that as the target for your sound:

createEmptyMovieClip("music_holder",1000);
myMusic = new Sound(music_holder);
myMusic.attachSound("Sound");
myMusic.start(0, 99);

slider.control._y = -50;
slider.control.onEnterFrame = function() {
myMusic.setVolume(0-this._y);
};
slider.control.onEnterFrame = function() {
myMusic.setVolume(0-this._y);
};
slider.control.onPress = function() {
startDrag(this, false, this._x, -100, this._x, -9);
};
slider.control.onRelease = function() {
stopDrag();
};

Creative Ravi
8/18/2005 1:02:12 PM
hi friends,
I am working on a cbt project, in it i have a background
sound and other voice over's sound. Now i want to control only background sound
when i drag slider for controlling volume. Problem is that when i drag slider
it controls volume of both sounds, i.e. background and voice over both. Can
anyone tell me how can i control only background sound. Here i am giving sample
code that i have used in my file yet -

myMusic = new Sound(this);
myMusic.attachSound("Sound");
myMusic.start(0, 99);

slider.control._y = -50;
slider.control.onEnterFrame = function() {
myMusic.setVolume(0-this._y);
};
slider.control.onEnterFrame = function() {
myMusic.setVolume(0-this._y);
};
slider.control.onPress = function() {
startDrag(this, false, this._x, -100, this._x, -9);
};
slider.control.onRelease = function() {
stopDrag();
};

AddThis Social Bookmark Button