This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2012-02-07 15:49:00

zizou98
New Scratcher
Registered: 2012-02-07
Posts: 11

How do I make music stop?

please help, I can't make it stop! I need a music to play, but when you go to another screen it has to stop. Help!!!

Offline

 

#2 2012-02-07 16:07:36

RedRocker227
Scratcher
Registered: 2011-10-26
Posts: 1000+

Re: How do I make music stop?

Use the

stop all sounds
block  wink


Why

Offline

 

#3 2012-02-07 16:18:22

zizou98
New Scratcher
Registered: 2012-02-07
Posts: 11

Re: How do I make music stop?

Thanks man, I'll see if it works  smile

Offline

 

#4 2012-02-07 16:33:05

Purika
Scratcher
Registered: 2011-01-26
Posts: 100+

Re: How do I make music stop?

zizou98 wrote:

Thanks man, I'll see if it works  smile

It should do!  smile


https://lh3.googleusercontent.com/-ZlPXbnYAtro/TxRNNopA6XI/AAAAAAAAAvY/worvlbyfCYI/s589/Purika.gif
If I was three birds, I could see myself fly below us!  big_smile

Offline

 

#5 2012-02-07 16:43:38

Zparx
Scratcher
Registered: 2011-03-23
Posts: 500+

Re: How do I make music stop?

Sounds are tricky to work with. If you want it to loop, you will most likely need a variable system to work with. Something I always do is:

when whatever to initiate sound happens
set variable to 1
repeat until <variable = 0>
play new sound until end
end
Then, when you want that sound to stop looping or switch to another sound:

when whatever happens to stop sound
set variable to 0
stop all sounds                 //this is absolutely necessary after setting your variable.
switch to new sound 
set variable to 1                //everything on this line and after is the same as first script. Same variable to switch sounds.
repeat until <variable = 0>     
play new sound until end
end
Hope I helped! (:


http://images3.wikia.nocookie.net/__cb20101119183412/halo/images/4/43/Hero2.png
^ My rank on Halo: Reach :3

Offline

 

#6 2012-02-08 11:23:45

zizou98
New Scratcher
Registered: 2012-02-07
Posts: 11

Re: How do I make music stop?

They dont work  sad
I want the main menu music to play, but suddenly stop when you click the shop button and at that point the shop music plays. Is that possible?

Offline

 

#7 2012-02-08 11:36:17

RedRocker227
Scratcher
Registered: 2011-10-26
Posts: 1000+

Re: How do I make music stop?

Are you using broadcasts for when the shop button is clicked?


Why

Offline

 

#8 2012-02-08 11:38:15

zizou98
New Scratcher
Registered: 2012-02-07
Posts: 11

Re: How do I make music stop?

yes, and i also added a variable that changes every time you go to a different menu.

Offline

 

#9 2012-02-08 11:41:28

Paddle2See
Scratch Team
Registered: 2007-10-27
Posts: 1000+

Re: How do I make music stop?

Can you give is a link to your project?  It's easier to see the problem if the scripts are available.


http://i39.tinypic.com/2nav6o7.gif

Offline

 

#10 2012-02-08 11:55:48

zizou98
New Scratcher
Registered: 2012-02-07
Posts: 11

Re: How do I make music stop?

this is the link. http://scratch.mit.edu/projects/zizou98/2320070
There is no actual game yet because I want to put the music in first, to get something out of the way.
PLEASE HELP! THIS IS FOR A SCHOOL PROJECT!!!
And yes it is based on the works of HP lovecraft.  smile

Offline

 

#11 2012-02-08 14:41:27

zizou98
New Scratcher
Registered: 2012-02-07
Posts: 11

Re: How do I make music stop?

nevermind, I managed it.

Offline

 

#12 2012-05-08 13:46:10

TomPetrov
New Scratcher
Registered: 2012-05-08
Posts: 3

Re: How do I make music stop?

zizou98, how did you manage it? I need to do a school project, too. I can't change loop from main menu to bonus. Please help me out. I'll owe you a lot.

Offline

 

#13 2012-05-08 13:49:59

TomPetrov
New Scratcher
Registered: 2012-05-08
Posts: 3

Re: How do I make music stop?

zizou98, how did you manage it? I need to do a school project, too. I can't change loop from main menu to bonus. Please help me out. I'll owe you a lot. If there's something you want in change, tell me.

Offline

 

#14 2012-05-10 02:56:37

sonicfan12p
Scratcher
Registered: 2011-11-16
Posts: 1000+

Re: How do I make music stop?

Although the variable idea is a good one, if you are using a forever loop, it will continue to play the song to it's end, and then switch. Or worse,play them both at the same time. What you can do, is send a broadcast every time you go to the menu, or bonus screen. Then have scripts that say, when i recieve menu, stop all sounds, play sound menu music until done. That way, the sounds actually stop. The only downside is it won't loop.


Why are the secret organizations getting all the attention?  mad

Offline

 

Board footer