Be a Supporter!

how you make mute button

  • 476 Views
  • 8 Replies
New Topic Respond to this Topic
elbarto66
elbarto66
  • Member since: Jun. 30, 2006
  • Offline.
Forum Stats
Member
Level 15
Blank Slate
how you make mute button 2007-12-24 20:21:56 Reply

just wanted to know so on my later games I can use it


easy to make money just takes some time
http://www.neobux.com/?r=elbarto661

iamironman
iamironman
  • Member since: Aug. 5, 2006
  • Offline.
Forum Stats
Member
Level 13
Blank Slate
Response to how you make mute button 2007-12-24 20:35:38 Reply

draw a square
higlite it
hit F8
if you cant figure it out from their quit


(\_/)
( '.' )
(")(") this is bunny, copy and paste him to your forum signaturse to help him gain world domination

elbarto66
elbarto66
  • Member since: Jun. 30, 2006
  • Offline.
Forum Stats
Member
Level 15
Blank Slate
Response to how you make mute button 2007-12-24 20:44:24 Reply

hey what the fuck is up with you
I know how to make a fucking button
I need the code for a mute button
why does everone on ng have to ass holes


easy to make money just takes some time
http://www.neobux.com/?r=elbarto661

elbarto66
elbarto66
  • Member since: Jun. 30, 2006
  • Offline.
Forum Stats
Member
Level 15
Blank Slate
Response to how you make mute button 2007-12-24 20:50:25 Reply

can anyone give me the mute code plz


easy to make money just takes some time
http://www.neobux.com/?r=elbarto661

under-siege
under-siege
  • Member since: May. 11, 2007
  • Offline.
Forum Stats
Member
Level 03
Blank Slate
Response to how you make mute button 2007-12-24 21:14:53 Reply

It's not really as easy as just adding some code to the button.

First you need an elegant way of playing your sounds. So you need a Sound object and a function to trigger the sounds.

On your button set a flag, eg mute=false or mute=true, then in your playSound function, check if it's muted or not before playing the sound. The alternative would be to set the volume of your sound object to 0.

Kart-Man
Kart-Man
  • Member since: Jan. 7, 2007
  • Offline.
Forum Stats
Member
Level 27
Blank Slate
Response to how you make mute button 2007-12-24 21:34:53 Reply

At 12/24/07 09:14 PM, under-siege wrote: It's not really as easy as just adding some code to the button.

First you need an elegant way of playing your sounds. So you need a Sound object and a function to trigger the sounds.

On your button set a flag, eg mute=false or mute=true, then in your playSound function, check if it's muted or not before playing the sound. The alternative would be to set the volume of your sound object to 0.

In summary:

Go take a look at AS: Sound before you begin. Hopefully you've declared Sound objects and attached sounds to them instead of doing something like dragging a sound onto the Timeline.


postcount +=1;
Newgrounds Photoshop Headquarters || Don't use MS Paint! Use Aviary!
SING US A SING YOU'RE THE PIANO MAN

BBS Signature
Nicholas-Deary
Nicholas-Deary
  • Member since: May. 12, 2006
  • Offline.
Forum Stats
Member
Level 39
Animator
Response to how you make mute button 2007-12-25 06:35:25 Reply

Does no one here no action scrip?! >:(

on(release) {
StopAllSounds () ;
}

I think that should do it.


BBS Signature
elbarto66
elbarto66
  • Member since: Jun. 30, 2006
  • Offline.
Forum Stats
Member
Level 15
Blank Slate
Response to how you make mute button 2007-12-25 11:00:40 Reply

At 12/25/07 06:35 AM, Nicholas-Deary wrote: Does no one here no action scrip?! >:(

on(release) {
StopAllSounds () ;
}

I think that should do it.

thanks you thats what im talking about code thats the thing I love code!!!!!!!!!!!!!
thanks is there any way I can pay you back


easy to make money just takes some time
http://www.neobux.com/?r=elbarto661

EKublai
EKublai
  • Member since: Dec. 13, 2003
  • Offline.
Forum Stats
Member
Level 18
Animator
Response to how you make mute button 2007-12-25 12:12:34 Reply

Haha, I love it when all a person asks is how to do a simple command like StopAllSounds and then everyone is all "OMG AS: Sound n00b!" Just in case you guys have forgotten, the point of referencing the AS threads is to be helpful, not just to be an asshole.


BBS Signature