Click button and play audio once

Get help using Construct 2

Post » Thu Nov 29, 2012 5:53 am

Hi all,

I am new to Construct 2 and made a button to play an audio.
However, when I click the second time of the button, the audio plays but overlaps.

Can I just play the audio once no matter how many time I click on the button?
I tried "System > Trigger once" but not successful.

Please kindly help! Thank you so much.

Mikemike2012-11-29 08:53:15
B
5
S
1
G
1
Posts: 10
Reputation: 1,184

Post » Thu Nov 29, 2012 9:32 am

Set up ether a global variable (if its across more then one layout) or a local variable.

When the user click play set the variable to 1 or playing or something you can easily recognise
Then you can set up the button will only work when the variable is equal to something you have chosen such as not_playing
I'm presuming you know how long the song is, so to repeat this action again you could set up another event that after 60 seconds and the variable is equal to playing then set to not playing.

Hope this helps
B
13
S
2
Posts: 87
Reputation: 1,244

Post » Thu Nov 29, 2012 11:51 am

Hi hugothewhitewolf,

Thank you very much. You are my star and I follow your concepts and made it.
Attached an Event Sheet that may shorten development for somebody in the future :)
http://www.flickr.com/photos/68746253@N07/8229794250/

Cheers,
Mike

P.S. Sorry that I cannot post URL as my REP is less that 500 :)mike2012-11-29 11:55:05
B
5
S
1
G
1
Posts: 10
Reputation: 1,184


Return to How do I....?

Who is online

Users browsing this forum: austinblackbelt, Matthew de, Skebab, spcsmrf and 6 guests