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

#1 2012-04-21 07:08:58

Noobie600
New Scratcher
Registered: 2012-04-21
Posts: 7

Sound Button on and off

How do you make a sound button which you can toggle on and off?

Offline

 

#2 2012-04-21 07:51:58

pi3
Scratcher
Registered: 2011-12-31
Posts: 500+

Re: Sound Button on and off

Check out this Scratch Wiki Tutorial for help with this.  smile


http://i44.tinypic.com/ofdhc4.jpgThanks FreshStudios!

Offline

 

#3 2012-04-22 09:35:07

RogueDream01
New Scratcher
Registered: 2012-02-12
Posts: 9

Re: Sound Button on and off

[scratchblocks]
when sprite1 clicked
switch to background [off v]
broadcast <(off)>
end

Offline

 

#4 2012-04-22 14:00:17

AgentRoop
Scratcher
Registered: 2012-02-11
Posts: 1000+

Re: Sound Button on and off

Try this simple script for your sprite:

When [sprite* v] clicked //* make this be whatever your sprite's name is
if <(Volume)=(0)>
  set volume to [100] %
  switch to costume [volume on v]
else
  Set volume to [0] %
  switch to costume [volume off v]
end
I hope that this helps!  smile

Last edited by AgentRoop (2012-04-22 14:03:09)


La La
I wrote an album.

Offline

 

#5 2012-05-22 09:45:41

selenamarte
Scratcher
Registered: 2012-04-21
Posts: 78

Re: Sound Button on and off

when gf clicked
switch to costume [sound on v]
set [on? v] to [1]

when [Sprite1 v] clicked
next costume
set [on? v] to ( [-1] * (on?) )
if < (on?) = [1] >
  set volume to [100] %
end
if < (on?) = [-1] >
  set volume to [0] %
end

when gf clicked
play sound [any song you like v] until done

Last edited by selenamarte (2012-05-26 06:35:18)


http://scratch.mit.edu/static/projects/selenamarte/2691436_sm.png

Offline

 

Board footer