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.
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]
on (release) {
mySound = new Sound();
mySound.attachSound("seagulls");
mySound.start(0, 99);
}
Try that
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);
}