Sound Control

Well, I can’t figure this out!! I add a sound layer to any scene in my movie, set it to Sync: Start; Loop: 5 in Properties–then when I Test Movie if I click a button to go to a different scene the music keeps playing. Why can’t I get the music to stop when I leave the scene it’s located in??? HELP!!

on(press){
mySound.Stop();
}

but i think your loading your sounds incorrectly

here is a qucik tut i wrote for some one

ok here’s a short and brief tutorial.

import your sound:
file >> import

go to your library and right click on the first mp3. go to linkage:
give it the name sound1 and check the first and last checkboxes.

go to your timeline:
create a new layer for your actions. give frame 1 these actionsL

mySound = new Sound();
mySound.attachSound(“sound1”);
mySound.start(0,999):

your first sound should now play
if you dont want your sound to start automatically then just leave out the last line of code.

give your first thumbnail these actions:

on(release){
mySound.start(0,999);
}

now u must repeat these steps for all buttons. to disable sounds when u click another button give your button these actions:

on(release){
mySound.stop();
}

Thanks for helping, but this is how dumb I am…I’m following you until you get to the “give your first thumbnail these actions:”–ahhhhhh, what’s a “thumbnail”? Do you mean the first button in this scene (which does have sound on it) and also has these actions on the button: on (release) {
gotoAndPlay(“home”, 1);
}
Do I add the – on(release){
mySound.start(0,999);
}

to this button? --just did, and the music still plays when I leave this scene. I’m LOST

o, i should have been more clear. the thumbnail in this case would represent your audio button or what ever button you want to start your audio. if you wish not to have to click a button to start your audio i will show you how.

If you want button to start audio:
[AS]
on(release){
gotoAndPlay(“home”); //in your case
mySound.Start(0,999); //“999” # of times to loop audio
}
[/AS]

If you want audio to start automatically:
[AS]
mySound = new Sound();
mySound.attachSound(“yoursoundname”);
mySound.start(0,999)
[/AS]

now to answer your question about stoppping sound for scene1:

Not sure how your movie is set up but you can do this a variety of ways. one way is if a button is calling scene2 give the button these actions
[AS]
on(release){
gotoAndPlay(“Scene 2”);
mySound.Stop();
[/AS]

or if a button does nto call scene 2 on the last frame of scene 1
apply this code:
[AS]
mySound.stop();
[/AS]

hope that clears things up

Well, thanks a lot for your help–I got it to work. I have 2 more questions if you wouldn’t mind:

  1. Is there some additional ActionScript that could be added to the button that takes me to the next scene that will FADE OUT the music when button is clicked? It’s script is:
    on(release){
    gotoAndPlay(“home”, 1);
    mySound.Stop();
    }

  2. When I use the same ActioScript and try to put the sound in a movie clip (with an actions layer inside the movie clip), it no longer works–the music continues to play in the next scene. Can’t sound be put in a movie clip with the actions inside the movie clip?

As you’re seeing, I’m really dumb when it comes to ActionScript!!
Thanks again.