PDA

View Full Version : Changing a looped sound between scenes


xombi
04-03-2003, 06:16 PM
I have a site which contains two scenes (Day and Night). On scene one(Day) I have a looped sound (Day_Sound). When I click around to change the content within scene one the looped sound continues to play perfectly.
When I click to move to scene two(Night) the sound changes (to Night_Sound) and loops perfectly and continues to loop wherever I am in the playhead. So far no problems.
However, once in scene 2, if I move backwards within the scene it plays the loop from scene one(Day_Sound) as well as the loop from scene 2(Night Sound).

I am assuming that I will need use some actionscript that will represent something (this is horribly crude) like:
if in "Day" play Day_Sound.
if in "Night" stop Day_Sound, play Night_Sound.
if in "Day" stop Night_Sound, play Day_Sound.

To complicate matters I have created two movie clips containing the seperate sound files and have placed each of them into a layer in their respective scenes (this may have been entirely the wrong thing to do).

I have checked the tutorials, but I'd be very grateful if anyone could help (and that I made some form of crude sense).

regards
Xombi

tigei3281
04-05-2003, 12:36 AM
I'm kind of confused...can you post your fla?

jcalabro
04-26-2006, 11:09 PM
hey
easiest thing to do
on either a button or MC
button

on (release) {

//stopAllSounds
stopAllSounds();
soundclip = new Sound (soundLoader);
soundclip.loadSound("SOUNDLOCATION", true);

}

MC

onClipEvent(enterFrame) {

//stopAllSounds
stopAllSounds();
soundclip = new Sound (soundLoader);
soundclip.loadSound("SOUNDLOCATION", true);

}


then on either your new button or MC, same code just change var name

guiltfilter
04-27-2006, 08:01 AM
I would take a look at adding soundclip.start() and soundclip.stop() actions on frame 1 of your scenes though it would be good to see your fla.

Its been said many times that scenes suck and if you could use frame labels or put everything on frame 1 that would be preferred.