Having Trouble Attaching Sound To Button!

Hey there Fellow Flashers,

I am trying to attach a sound to a button, but I do not want to have the sound on the timeline. In other words I am trying to have the sound triggered via action script.

I know the code should be something similar to the following:

on (release) {
Sound = new Sound();
sound.attachSound(“seagulls”);
}

However, I’m not quite sure this is right. Well, I know it’s not right because my sound is not working…

Anyway, if there’s anyone out there that can be of assistance please let me know.

Thanks,

Kelly

would it b anything like this…
http://www.kirupaforum.com/showthread.php?s=&threadid=9670

So you have your sound set in the linkage properties?

Open up your library, right click on your sound file, the choose “linkage”, then check “Export for Actionscript” then in the name box put “seagulls” (no quotes).

[edit]hey would you look at that… a recent thread with the same subject… that coulda saved me some explaining…lol, thanks slayerment [/edit]

Hey Beta.

I I did that with the linkage and it still didn’t work. what I’m trying to do is get a sound to play on release. Not sure why it’s not working???

Thanks,

Kelly

on (release) {
mySound = new Sound();
mySound.attachSound("seagulls");
mySound.start(0, 99);
}

Try that :slight_smile:

Now defining the new Sound() object each on Release doesn’t make sense, so you can put it on the _root timline and have your button code look like this…

on (release) {
_root.mySound.attachSound("seagulls");
_root.mySound.start(0, 99);
}