-
Sound button
Hi
I'm building a portfolio-based site with background music, images and a couple movies. I've built a landing page where you can control the sound (with a toggle button I got off the net, that works perfectly). A button on the landing page imports an external swf which gives a choice of videos to watch. Clicking on these buttons stops the sound and plays one of the movies.
This is where I run into problems. There's a back button over the movies; when this is clicked or the movie comes to an end I want the sound to start again. I've tried loads of bits of code and can't suss it out.
here's the code on the button that stops the sound and plays the movie:
Code:
on(release){
_parent._parent.newsound.stop();
_parent.gotoAndStop("why");
}
and here's the code on the sound button:
Code:
onClipEvent (load) {
_root.soundstatus = "on";
_root.mySound = new Sound(_root.soundbutton);
_root.mySound.attachSound("song1");
_root.mySound.start(0, 1000);
maxvolume = 90;
minvolume = 0;
}
onClipEvent (enterFrame) {
if (_root.soundstatus == "on") {
step = 5;
}
if (_root.soundstatus == "off") {
step = -5;
}
maxvolume = maxvolume+step;
if (maxvolume>100) {
maxvolume = 100;
}
if (maxvolume<0) {
maxvolume = 0;
}
_root.mySound.setVolume(maxvolume);
}
I'm pretty poor at coding and don't really understand this stuff, it would be great if anyone can help. Thanks in advance