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

#1 2013-04-27 10:57:47

Zottenpedj
New Scratcher
Registered: 2013-03-27
Posts: 3

pause music

Hello,

I'am making a game and i have a song playing on the background.
problem is I have a pause button zo i should be able to pause the song. (not stop and start again)

I work with a variable for pause, so the music should play when pause=0
and pause when pause=1

anyone can help me with this?

Arne

Offline

 

#2 2013-04-27 16:40:30

ErnieParke
Scratcher
Registered: 2010-12-03
Posts: 1000+

Re: pause music

Zottenpedj wrote:

Hello,

I'am making a game and i have a song playing on the background.
problem is I have a pause button zo i should be able to pause the song. (not stop and start again)

I work with a variable for pause, so the music should play when pause=0
and pause when pause=1

anyone can help me with this?

Arne

Yes, I can. One way that you could about doing this is:

when gf clicked
forever
 if <(pause) = (1)>
  set volume to (0) %
 else
  set volume to (100) %
 end

This script makes the volume 0 whenever pause is 1, but then this also mutes other sound effects in your sprite, so be careful about that.

Well, I hope that I helped!

With regards,

ErnieParke


http://i46.tinypic.com/35ismmc.png

Offline

 

Board footer