Script for turning audio on/off

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
abanowBUSTfGf
Posts: 63
Joined: Sat Dec 22, 2012 3:01 am

Script for turning audio on/off

Post by abanowBUSTfGf » Sat Jan 05, 2013 3:16 am

I have audio on and audio off graphics. I'd like to be able to click on the audio-off
button to a) turn off audio and b) display the audio-on button and the reverse for
the audio-on button.
Tx

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: Script for turning audio on/off

Post by Simon » Sat Jan 05, 2013 3:53 am

HI,
Look up playLoudness in the dictionary. That will do the muting for you.
Use the button icon property to set your images. and check this out:

Code: Select all

on mouseUp
   if the highlite of me then
      set the playLoudness to 0
      set the hilight of me to false
   else
      set the playLoudness to 100
      set the highlite of me to true
   end if
end mouseUp
The true false may be backward.

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

Post Reply