[Solved] How do I make a button to turn on and off sound

Get help using Construct 2

Post » Tue May 20, 2014 7:16 pm

I'm using this logic

If touch on setting and togglesound is 1, turn off music, set togglesound 0

If touch on setting and togglesound is 0, turn on music, set togglesound 1

But, it's not working, whenever I touch the button it simply loop the sound to start

Any help?


---
edit
Nevermind, found toggle silent function
Last edited by ijoin on Thu May 22, 2014 7:45 pm, edited 1 time in total.
B
8
S
2
Posts: 203
Reputation: 1,169

Post » Tue May 20, 2014 10:27 pm

You also need to add logic to any event that would play sound to check the value of togglesound and only play if togglesound is 0
B
49
S
12
G
10
Posts: 1,833
Reputation: 14,603

Post » Tue May 20, 2014 10:28 pm

Ah, you found an answer, can you then mark this topic (the subject of this thread) with the [Resolved] that way people don't keep coming in to answer.
B
49
S
12
G
10
Posts: 1,833
Reputation: 14,603

Post » Thu May 22, 2014 12:52 pm

As notified on manual audio stop "" can stop a sound BUT doesn't work or wrong used.
Using an onclicked button with a Audio Play "sample_name" and a simple button (onclicked) - Audio Stop "sample_name" then ... nothing the sound is still playing with or not preload
any one have a clue about this or the audio stop nothing but the last sound ?
B
4
Posts: 10
Reputation: 222

Post » Thu May 22, 2014 2:56 pm

[solved]
when using Play action "sound_sample" you need to set the Tag there then this tag will be used later to stop the correct sound.
as
Audio | Play "sound_sample" not looping at volume 0 dB (tag "sound_01")
B
4
Posts: 10
Reputation: 222

Post » Thu May 22, 2014 3:57 pm

BluePhaze wrote:Ah, you found an answer, can you then mark this topic (the subject of this thread) with the [Resolved] that way people don't keep coming in to answer.

We must do it manually?
Like add [resolved] on the title?

jexbe wrote:[solved]
when using Play action "sound_sample" you need to set the Tag there then this tag will be used later to stop the correct sound.
as
Audio | Play "sound_sample" not looping at volume 0 dB (tag "sound_01")

Glad you found it
B
8
S
2
Posts: 203
Reputation: 1,169

Post » Thu May 22, 2014 5:25 pm

@ijoin Yes, you just edit the post and change the subject. It can't do it automatically, how would a web site know that your problem was resolved?
B
49
S
12
G
10
Posts: 1,833
Reputation: 14,603

Post » Thu May 22, 2014 7:45 pm

BluePhaze wrote:@ijoin Yes, you just edit the post and change the subject. It can't do it automatically, how would a web site know that your problem was resolved?

I mean like a button to mark question solved :D

BTW, BluePhaze, can you help me with the sound toggle not working on cocoon js ported android app?
I've already made another thread about this, but so far found no solution
B
8
S
2
Posts: 203
Reputation: 1,169

Post » Thu May 22, 2014 8:43 pm

I will take a look, at work now though so can't spend too much time on the site :)
B
49
S
12
G
10
Posts: 1,833
Reputation: 14,603

Post » Fri May 23, 2014 4:32 pm

BluePhaze wrote:I will take a look, at work now though so can't spend too much time on the site :)


Thanks pal ! :D
B
8
S
2
Posts: 203
Reputation: 1,169

Next

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 23 guests