Working with sound

SampySampy Member Posts: 0
edited March 2012 in Working with GS (Mac)
Hi I need help with working with sound.
I want to do the sound button, that can change image and change the sound to yes or no.
My problem is when I do the button that doesn´t change image and doesn´t change sound.
I need help to do the button.
Thanks

Comments

  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    edited March 2012
    Hi @Sampy

    A couple of ways to do this; you mentioned boolean as one of your tags; that'll be one way to go. Let's call the boolean Switch, set to the default false. Let's say you're starting off with your No image

    In the rules of the button:

    Rule:
    When touch is pressed
    When Switch is false
    Change Image to Yes.png
    Play Sound YesSound
    change Switch to true
    otherwise
    When Switch is true
    Change Image to No.png
    Play Sound NoSound
    change Switch to false

    This way works by flipping it every touch, which I'm guessing you're after. If you want it to flip on touch pressed and touch released, that'll have to be amended. Hope that's what you're after anyway.

    ----------------------------------------------------------------------------
    iPad app: End of the Earth –•– http://davidgriffinapps.co.uk/
    ----------------------------------------------------------------------------

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

  • CloudsClouds Member Posts: 1,599
    @gyroscope

    I suspect (but am not sure) he simply wants a button that mutes the audio ?
  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    Hiya Tynan: I suddenly see what you mean! "change the sound to yes or no" I assumed he meant a sound, like a voice, saying Yes and No.... whoops! Ah well, I tried! :-)

    OK, @Sampy, that'll be:

    Rule:
    When touch is pressed
    When Switch is false
    Change Image to On.png
    Change Attribute game.Audio.Sound Volume to 1
    change Switch to true
    otherwise
    When Switch is true
    Change Image to Off.png
    Change Attribute game.Audio.Sound Volume to 0
    change Switch to false

    I wait to see if I've got it right this time! :-)

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

Sign In or Register to comment.