The way I have it you would put it in a frame on your main timeline where you have all of your actionscripts and you reference the button by its name.
If applying the rollovers to the actual button you could do this–(NOT in the button editors over state but on the actual button by clicking it one time with your mouse on the stage and opening the actions panel and putting the code in with expert mode.)
on (rollOver) {
yourSound.play();
}
on (rollOut) {
yourSound.stop();
}
Here, yourSound is the name you have given your sound in your library.
Whoops! Messed up a tad on the action that gets the sound to play…
sorry.
Here is the real code… my bad.
on (rollOver) {
yourSound.start(0, 5);
}
Here 0 is the amount of seconds that you want to pass before the sound starts playing and 5 equals the amount of times you want the sound to loop while playing. Change the 0 or 5 however you wish to do your playback.
.play() was my error.
.start() is the correct way to trigger the sound to play.
You will probably want to do this in a frame on the timeline where you button is on another level.
yourSound = new Sound();
yourSound.attachSound(“yourSoundsIDintheLibrary”);
This will create a new sound object with the name yourSound and attach it to the timeline’s frame. “yourSoundsIDintheLibrary” is just to be changed to the name of the sound sample as it appears in your object library.
make sure you go to your library, right click on your sound file and make sure the firts 2 checkboxes are ccheck and u gave the osudn the name heartbeat