Newgrounds.com — Everything, By Everyone.

Checking login status…

USERNAME:

PASSWORD:

Logging in…

Logged in as:
.
Logging out…
Inbox My Account Log Out


Forum Topic: Button Sound Trouble

(275 views • 5 replies)

This topic is 1 page long.

<< < > >>
None

CorpusInvictus

Reply To Post Reply & Quote

Posted at: 5/13/06 12:03 PM

CorpusInvictus EVIL LEVEL 07

Sign-Up: 08/02/05

Posts: 59

Concerning my first exploits into AS, most of the functions I can script into my buttons work. But how can I make a sound play upon pressing a button? There doesn't seem to be an action that coincides with the effect I desire.
Thanks for any help.


None

Kirk-Cocaine

Reply To Post Reply & Quote

Posted at: 5/13/06 12:05 PM

Kirk-Cocaine EVIL LEVEL 33

Sign-Up: 08/17/03

Posts: 16,387

AS: Sound by Denvish

^All you need to know about AS and sound.


There are days when we all say we feel we just can't go on, but you've felt this way all along...

BBS Signature

None

ChromeShark

Reply To Post Reply & Quote

Posted at: 5/13/06 12:09 PM

ChromeShark LIGHT LEVEL 31

Sign-Up: 02/02/05

Posts: 73

First of all, you need the sound to export for actionscript:

-Right Click your sound in the library
-Select 'Linkage'
-Check 'export for actionscript'
-Type something in the Identifier box eg 'mySound'

Now the button script:

on(press){
mySound = new Sound(this);
mySound .attachSound("mySound");
mySound.start(0, 1);
}

That will play the sound once when the button is pressed. There's lots of things you can do with this, one useful one is to change the number 1 in the brackets to get the sound to play more than once eg mySound.start(0, 5); will play it 5 times.

Hope this helps :)

BBS Signature

None

CorpusInvictus

Reply To Post Reply & Quote

Posted at: 5/13/06 12:11 PM

CorpusInvictus EVIL LEVEL 07

Sign-Up: 08/02/05

Posts: 59

Thanks a whole heap, that coveres pretty much everything. Cheers.


None

CorpusInvictus

Reply To Post Reply & Quote

Posted at: 5/13/06 12:36 PM

CorpusInvictus EVIL LEVEL 07

Sign-Up: 08/02/05

Posts: 59

I tried that way of doing it orpheus, though when i preview it, it is a button, when I click it, it doesn't make a sound.


None

mrEotter

Reply To Post Reply & Quote

Posted at: 5/13/06 12:40 PM

mrEotter NEUTRAL LEVEL 10

Sign-Up: 05/21/05

Posts: 602

When i first did it... I used this pretty newb way of going into the editing the button (where it tells you hover, click, release thing) and add a sound to clik or something then make it event... that's what i'd do but no one seems to notice it so it must be bad :3


All times are Eastern Daylight Time (GMT -4) | Current Time: 12:55 PM

<< Back

This topic is 1 page long.

<< < > >>
You need a Grounds Gold Account to post on the NG BBS! If you don't have one, click here to sign up now! It's fast, free, and easy — and opens up tons of great NG features!