PDA

View Full Version : Sound Buttons


apinel
04-24-2001, 09:12 PM
Im creating a soundboard (a page with a lot of buttons that play different sounds when clicked). I want to use just one symbol for all the buttons even though every instance plays a different sound. Can someone please explain to me in detail how to do this? Do i have to use actions? If so what would be the code to make a button play a *.wav file when clicked?

the_wizard
04-25-2001, 12:21 AM
Do a search or look under sounds and buttons.

Basically what you will do is the following.

1/ Create you Button
2/In the Button Scene Add a Layer
3/The sound is place under the action (Over or down etc)

Import a sond file
Using the menus at the top.
File / Import (Select the sound file click ok)

Now using the menus agian
"windows" and select "library"
look in the list for your sound file and drag it in to the scene. Assuming that you have inserted a black Key frame
in the new layer under "Over"

Hope it helps

Jesse
04-27-2001, 09:16 AM
Look into the .attachSound() method (See the actionscripts dictionary fromt he Flash Help drop down). Note that it would probably take less time to just manually put the wav files into buttons than it will to give each a linkage name and use the attachSound method.

Cheers

Jesse

TREQQER
08-23-2006, 02:55 AM
Here's my situation: I need a sound file (wav, mp3, etc.) to play when the button is either rolled over or pressed. I do not want to insert the sound into the button itself! Instead, I want to make a call to the audio file from the library or from a sound file folder. If I add the sounds to the buttons themselves, the Flash file and resulting .swf will become too big in size. I think I'm on the right path in wanting to use the "onPress" function and the "attachSound" feature. I need to use Actionscript to achieve this, and I will appreciate any help I can get from anyone. Thanks!

oldnewbie
08-23-2006, 06:39 AM
Edited out!

TREQQER
08-24-2006, 03:34 AM
I still can't get a sound button to work. This is incredibly frustrating! Here's the error code I keep getting:

Scene=Scene 1, Layer=Layer 2, Frame=1: Line 4: Mouse events are permitted only for button instances
on(press) {

Can someone explain that to me and explain how to fix that and get a button with sound to work?! I'm losing my mind!

Thanks!
Nolan

oldnewbie
08-25-2006, 05:09 AM
Edited out!

TREQQER
08-25-2006, 05:22 AM
THANK YOU - THANK YOU - THANK YOU - THANK YOU Oldnewbie!!!! It works! Now I can get the sleep I need and not dream about Flash sound objects all night. You rock!

oldnewbie
08-25-2006, 12:16 PM
Grrrrrrrrrrrrrrrrreat! ;)