all groups > macromedia flash sitedesign > august 2005 >
You're in the

macromedia flash sitedesign

group:

Music clips


Music clips mms1fan
8/31/2005 12:00:00 AM
macromedia flash sitedesign: I want my buttons to play a sound clip on release. i have the sound clips on
one layer and the buttons on another. on release they send you to the frame
with that clip on it. problem is that when you click a new button, it plays the
new sound over the one already playing until the first one quits.
Re: Music clips pwiop
8/31/2005 11:46:50 PM
CAll your sounds usng actionscript - this invlolves

Leave the sound file in the library - not on a timeline

In the library right click the sound and select linkage then tick the 'export
for actionscrip' box
On your main timeline add the following code
mySound= new Sound()
then for your buttons add this code
b1.onRelease=function(){ //b1 being the name of your button
mySound.stop()// stops other sounds triggered by the buttons
mySound.attachSound("sound_1') //this should be the instance name of sound in
library
mySound.start(0,1)
}
AddThis Social Bookmark Button