Hi guys,
I’m trying to make a mute button in my Flash banner that changes icons when pressed.
Here is the code I’m currently using:
music = new Sound();
music.attachSound("SoundFileName");
music.start(0, 1);
music.setVolume(0);
vol = 0;
step = 3;
fade = 0;
onEnterFrame = function() {
if (fade == 1) {
vol = vol-step;
if (vol<0) {
vol = 0;
}
music.setVolume(vol);
} else {
vol = vol+step;
if (vol>100) {
vol = 100;
}
music.setVolume(vol);
}
}
And this is attached to the button:
on (release) {
(_root.fade=!_root.fade) ? 0 : 1;
}
I searched for this problem online for hours, and I found this code:
muteButton.attachmovie("newButtonLinkage", "NewName", 1);
But where should I put this code? Or should I attach it to the button? What else do I need to do to get it to work? Do I need to change my original code attached to the mute button or in the frame that calls the sound? I’m a bit lost at this point.
Any help is greatly appreciated! Thanks!
-RC