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

#1 2008-07-21 11:36:46

HarryPotterGal
Scratcher
Registered: 2008-04-02
Posts: 26

Help! How do I pause music?

How do I pause music with the click of a button and unpause it with a click of a button? Please help, ANYBODY!

Offline

 

#2 2008-07-21 11:37:40

the3rdage
Scratcher
Registered: 2008-07-20
Posts: 100+

Re: Help! How do I pause music?

HarryPotterGal wrote:

How do I pause music with the click of a button and unpause it with a click of a button? Please help, ANYBODY!

maybe like when a key pressed stop all sounds and when b key pressed play drum beat for 42 etc

Offline

 

#3 2008-07-21 11:38:46

the3rdage
Scratcher
Registered: 2008-07-20
Posts: 100+

Re: Help! How do I pause music?

HarryPotterGal wrote:

How do I pause music with the click of a button and unpause it with a click of a button? Please help, ANYBODY!

o and by the way next time post somethign like this is all about scratch or advanced scratch  smile

Offline

 

#4 2008-07-21 15:12:21

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

Re: Help! How do I pause music?

HarryPotterGal wrote:

How do I pause music with the click of a button and unpause it with a click of a button? Please help, ANYBODY!

I'm sorry to say,  but I don't think that is possible in Scratch at the moment.  You can stop it with the "Stop All Sounds" block but there is no way that I know of to start it back up again from the place where you stopped it. 

Probably the closest you could come would be to break the sound up into a series of shorter sound segments...then use a couple of variables and IF blocks to control which segment to play next.  You could get pretty close with that approach, but the sound would be pretty rough.


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

Offline

 

#5 2008-07-21 15:50:03

Maker
Scratcher
Registered: 2008-07-07
Posts: 30

Re: Help! How do I pause music?

Yea I was thinking the same too! They should make something like that in the next version of scratch.  I'm having the same problem.


http://img201.imageshack.us/img201/9176/mybanner488622f31da7bpx6.png

Offline

 

#6 2008-07-24 16:27:37

rivendell
Scratcher
Registered: 2007-05-29
Posts: 24

Re: Help! How do I pause music?

If you don't mind the music starting from the beginning when you click the sound on, try this.  Create a sprite and put the following scripts in it.  When you click the sprite, the music will toggle on and off.

[blocks]
<when green flag clicked>
<set{ playsound }to( 1
<forever>
<if><( <{ playsound }> <=> 1 )>
<play sound[ music ]and wait>
<end>
<end>

<when[ mute sprite ]clicked>
<set{ playsound }to( (( 1 <-> <{ playsound }> ))
<if> <( <{ playsound }> <=> 0 )>
<stop all sounds>
<end>
[/blocks]

Note that "play sound and wait" has been replaced by "play sound until done" in Scratch 1.2.  This method will also stop any sound effects that are currently playing when the mute sprite is clicked.

Offline

 

Board footer