Hey Kirupians,
I am working on a website and what I want to do is to add some music to the site. I only want to have one song playing, so all I need is an on/off button. So I created a button and attached this code:
on (release) {
if (music=0){
gotoAndStop(1);
_root.soundcontent.loadMovie("silence.swf")
music=1
}
else {
gotoAndStop(2);
_root.soundcontent.loadMovie("empty.swf")
music=0
}
}
The gotoAndStop commands are for the button (which is a mc) itself, to change states (sound waves when music is on, red cross when the music is off).
silence.swf is the name of the swf containing the music (Delerium - Silence, beautifull song btw), empty.swf is just an empty mc to turn the sound off. I also added music=1 to my main timeline so that the music starts playing when the site opens.
I’m an actionscript noob so I dunno if I’m doing this correct. Maybe I’m just screwing up. Anyway I hope this is still understandable. If anyone needs the .fla file just ask. Hope someone can help me.
Thnx in advance, Code R.