hover music

Get help using Construct 2

Post » Thu May 31, 2012 8:11 pm

Hello I want it so when I hover over a sprite it will play sound from an external .mp3
Thanks
B
15
S
2
G
1
Posts: 108
Reputation: 1,902

Post » Thu May 31, 2012 8:28 pm

Condition "Mouse: On cursor over object" => Action "Audio: play sound"

Also you don't want to use mp3 as audio format.
Manual entry about sounds & musics and this blog article


For more technical infos on how to do in C2 : How do I FAQ section "Audio".Kyatric2012-05-31 20:31:05
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 6,998
Reputation: 57,791

Post » Thu May 31, 2012 8:29 pm

is there a way for it to play http://skyscape.sky.com/skynewsradio/RADIO/news.mp3
B
15
S
2
G
1
Posts: 108
Reputation: 1,902

Post » Thu May 31, 2012 8:31 pm

I've edited my previous post.
Check the links.

Also tutorial : how to add sounds, a beginner's guide
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 6,998
Reputation: 57,791

Post » Fri Aug 31, 2012 9:56 pm

@Kyatric

I've tried playing a sound on mouse over object, and it plays it constantly. And yes, looping is set to false.

Any ideas?
B
14
S
5
G
2
Posts: 20
Reputation: 2,378

Post » Fri Aug 31, 2012 10:14 pm

Event:
Invert "On mouse is hovering"

Action: audio stop
B
49
S
18
G
7
Posts: 429
Reputation: 8,888

Post » Fri Aug 31, 2012 10:15 pm

Have you made it so when it isnt over the object it stops?

Haha nevermind beat me to it :Pseskadog2012-08-31 22:16:01
B
15
S
2
G
1
Posts: 108
Reputation: 1,902

Post » Fri Aug 31, 2012 10:23 pm

I didn't want to have to stop the sounds, since not looping should do that for you.

I'm using a sprite with two different animations for the button states.

My solution ended up being 2 conditions: mouse over and is animation playing

Oh and thanks for the tips guys :)
B
14
S
5
G
2
Posts: 20
Reputation: 2,378

Post » Sat Sep 01, 2012 1:50 am

@helto: Actually, add a "System: Trigger once" condition to the "Mouse: Over object" event.

The problem here has not to see with the Audio object, but with how events work.
Every tick that a condition is true, it executes the actions.
So every tick that your mouse is over an object, the Audio object plays a sound.

The system condition "Trigger once" allows that the actions are only executed once while the conditions of the event are true, so it plays the sound only one time.

Edit: the condition to check if an animation is playing also does the trick for the same reasons.Kyatric2012-09-01 01:50:57
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 6,998
Reputation: 57,791

Post » Thu Nov 01, 2012 3:45 am

Hi, it was very helpful thank you
B
11
S
3
G
4
Posts: 22
Reputation: 2,794

Next

Return to How do I....?

Who is online

Users browsing this forum: Radulepy and 6 guests