hi,im trying to make a music/sound control and FX sounds control,so i have my FX volume level as a variable(FX_vol) and also the Music/sound volume level as a diffrent variable(M_vol),so i set them as sounds that i can use trough coding:
S1 = new Sound();
S1.attachSound(“soundFX”);
S2 = new Sound();
S2.attachSound(“soundM”);
and let the normal sound loop:
this.S2.start(0,99);
and i set that the sounds are allways getting their volume level(replace the old volume with the new one - for the player to set the music volume level and the sound FX volume level)
so it looks like this:
function onEnterFrame()
{
S2.setVolume(M_vol);
}
and on that function i added an option of when the FX sound will play(when the player hits the ‘Z’ key)
and it looks like this:
function onEnterFrame()
{
S2.setVolume(FX_vol);
S1.setVolume(M_vol);
if(Key.isDown(90))
{
this.SW.start();
}
}
*dont worry i added something to the code that you have to realease the Z key to press it again and make the sound again(so the problem is not here)
and when i run it both of the sounds(music and Fx) stays on the same volume and when i try to change the music volume level (in the running-i have some kind of a volume slider) and when i try to change the sound fx volume level they both stays the same,and dont change(not the sound fx and not the music…)
how can i fix that?