hi,
i have an mp3 that plays as background music to my website with a mute button that fades the music in or out. This works using the code below that i found on another site.
My problem is i would like to have this music added to an external swf that i could load into my main site in order to decrease the main site file size. When i load swf however, the music doesnt play. the button appears (which is also in the external swf) so i know that the movie is loading but no sound plays.
Can anyone help??
some_sound = new Sound();
some_sound.attachSound(“Kevin Spacey 16bit.mp3”);
some_sound.start();
some_sound.setVolume(100);
sound_set = true;
//
function increase_volume() {
counter++;
some_sound.setVolume(counter);
if (counter>=100) {
clearInterval(my_int);
}
}
//
function decrease_volume() {
counter++;
some_sound.setVolume(100-counter);
if (counter>=100) {
clearInterval(my_int);
}
}
//
sound_status = “normal”;
//
this.onRelease = function() {
clearInterval(my_int);
counter = 0;
//
if (sound_status == “normal”) {
my_int = setInterval(decrease_volume, 1);
sound_status = “muted”;
this.gotoAndStop(2);
} else {
my_int = setInterval(increase_volume, 1);
sound_status = “normal”;
this.gotoAndPlay(2);
}
};
//