Sound/Music On/Off Button problems

Get help using Construct 2

Post » Sat Aug 25, 2012 12:20 pm

I'm doing my best, but can't seem to figure it out. When I click (or touch) an icon (a music icon in this instance for sound disable/enable) I want it to go to the next frame, showing the same icon with an X over it. Just a graphical issue. When I program this in various ways, it either goes to the right frame, but won't go back when clicked again. Or it won't activate at all.

I have uploaded the CAPX file so it can be looked at.

MenuControlSheet has the options I've been working with, though I've thought the code should be in the SettingsSheet.

I would appreciate if someone could help me out with it.

NEEDED RESULT:
Go to Settings Screen
Click on Music icon and it changes to the Music with X icon, and turn off all music (which seems like it has to be done in it's own time since I don't have any music yet).

I'm most interested in the graphical implementation rather than the functionality of the purpose at the moment.

Below is the link to the ZIP that contains the CAPX.

Download ZIP of the CAPX
B
24
S
6
G
6
Posts: 255
Reputation: 3,649

Post » Sun Aug 26, 2012 3:16 am

The simplest solution is to have the button simply add to a variable when clicked, this way you won't get the thing toggled twice like you have right now. Both sub events are triggered because the first sub event changes the variable and makes the condition on the second sub-event true.


Here's a simple example just using the animation frames without any variables - all it does is count through the three frames and test which frame is displayed, and adjust sound based on that.



http://johnnysix.net/games/sound/

Download here :

http://johnnysix.net/games/sound/J6Soundexample.capx
Image
B
27
S
9
G
5
Posts: 487
Reputation: 11,939

Post » Sun Aug 26, 2012 5:20 am

Awesome, thank you very much! I had to get the R100 beta to use it. I hope the full version comes out, beta stuff is always iffy. Either way, thanks again!
B
24
S
6
G
6
Posts: 255
Reputation: 3,649


Return to How do I....?

Who is online

Users browsing this forum: CavalierBubble, Evanetot and 21 guests