Button to Turn Music On and Off
JoshKahane
Member Posts: 470
Hi
I am trying to create a button which when touched turns music off (volume to 0) and when pressed a second time comes back on of course. I have been using GS a long time now and I can't believe I can't this to work, hehe. You would think it was simple, as soon as I am told it I will think "Ahhh of course!".
Anyway I am having issues, Im doing it wrong. How can I get this working? Thanks.
I am trying to create a button which when touched turns music off (volume to 0) and when pressed a second time comes back on of course. I have been using GS a long time now and I can't believe I can't this to work, hehe. You would think it was simple, as soon as I am told it I will think "Ahhh of course!".
Anyway I am having issues, Im doing it wrong. How can I get this working? Thanks.
Comments
Pausing the music can also solve your dilemma. What does your Rule currently look like?
Currently I have when pressed change attribute 'Music' to false. Then I have a second rule the same in reverse, if touched become true. However this just makes it loop, it instantly goes off to on. So it doesn't work and I can't think of anyway to stop this.
http://gamesalad.com/wiki/how_tos:gsc_turn_sound_on_off#how_do_i_turn_music_on_and_off
Cheers, Weswog
If I am on Windows and Firefox (have no internet on my hackintosh), I can't see your video(s), because a missing plugin, which I can't install, because nobody knows, what plugin that supposed to be.
Thanks!
----
I would be interested in a slider for changing the music's volume.
Anybody with an idea, how to do that? I assume, I would have to use "change attribute" sound every 0.1 seconds by 0.1 or so...
But how do I do the slider?
I ended up using two buttons which is easy but I would have preferred one button which does both on and off thats all.
when musicOn = true:
Play Music (resume is one of the options on the Play Music list)
otherwise:
Pause Music
Then a button that toggles musicOn between true and false
Am i missing something?
Cheers, Weswog
Change attrib state=(state+1)%2
I didnt understand what you mean with modulus operator.