# Applieing sound to buttons and movieclips

**URL:** https://forum.kirupa.com/t/applieing-sound-to-buttons-and-movieclips/42537
**Category:** Uncategorized
**Created:** [February 10, 2004, 3:59am UTC](https://forum.kirupa.com/t/applieing-sound-to-buttons-and-movieclips/42537 "2004-02-10T03:59:25Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![mlkedave](https://avatars.discourse-cdn.com/v4/letter/m/958977/32.png) [@mlkedave](https://forum.kirupa.com/u/mlkedave)
#### Post date: [February 10, 2004, 3:59am UTC](https://forum.kirupa.com/t/applieing-sound-to-buttons-and-movieclips/42537/1 "2004-02-10T03:59:25Z")

</div>

I have a movieclip that is acting as a button. I want to apply a sound to it but Im not exactly sure how to go about this. I am using a HitTest and making it go either to the PrevFrame or the NextFrame depending if I am rolling over the movieclip or not… Any way, should I use some sort of AS to play a sound clip on an onRollOver or should I insert the sound clip in a frame?

Also, does anyone know a good site to get free sound bytes that are good for Flash sites? Thanks

Mike

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [February 10, 2004, 8:50pm UTC](https://forum.kirupa.com/t/applieing-sound-to-buttons-and-movieclips/42537/2 "2004-02-10T20:50:41Z")

</div>

anyone…

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [February 10, 2004, 8:58pm UTC](https://forum.kirupa.com/t/applieing-sound-to-buttons-and-movieclips/42537/3 "2004-02-10T20:58:57Z")

</div>

AS is the way to go. The easiest way is to create a Sound object and have it load that particular sound you want the movieclip to play when rolled over. Then, you assign an onRollOver handler to the movieclip and make that handler play the sound file.

Example code on the timeline which your button is in:

```auto

theSound = new Sound(yourmc);
theSound.loadSound("beep.mp3");
// or, attaching it from the library: theSound.attachSound("beep"), where beep is the linkage identifier
yourmc.onRollOver = function(){
theSound.start(0,1);
}

```

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [February 10, 2004, 9:05pm UTC](https://forum.kirupa.com/t/applieing-sound-to-buttons-and-movieclips/42537/4 "2004-02-10T21:05:59Z")

</div>

Thanks voets, while ur online can I ask u another question (you dont like PM right?)… Any way here it is.

I want to make it so when I click a button a movieclip transitions in (just by playing the first frame of the movieclip) but I also want to make it so when you push any other of the main buttons (buttons I have specified), it transitions out (plays a different frame of the current movieclip) and then the other moviecip transitions it.

I figured I could just compose each movieclip (containing several frames, on frame for a transition in, one frame for the standing still frame, and several frames for the transition outs). I need several frames for the transition outs because I will attach a gotoAndStop on EnterFrame on all of the last frames of the movieclip in the transition out frames.

this might not make a lot of sense but I basically want to be able to make a movieclip transition in and then transition out when another button is pushed… Is there a simpler method of doing this

By the way I want the transition in and out to just play a movieclip (not using AS to animate the graphic). Thanks\

Mike

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [February 10, 2004, 9:11pm UTC](https://forum.kirupa.com/t/applieing-sound-to-buttons-and-movieclips/42537/5 "2004-02-10T21:11:47Z")

</div>

[http://www.kirupaforum.com/forums/showthread.php?s=&threadid=39101](http://www.kirupaforum.com/forums/showthread.php?s=&threadid=39101) 😉

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [February 10, 2004, 9:23pm UTC](https://forum.kirupa.com/t/applieing-sound-to-buttons-and-movieclips/42537/6 "2004-02-10T21:23:19Z")

</div>

Thanks for the link, it will take me a while to get that… By the way my first website EVER using FLash or Photoshop (that is by the way the only program I used for graphics) will be done soon. I’m really proud of my first work considering I know absolutly no AS or anything. I mean had to learn what a ‘tween’ was 🙂

I would really like ur opinion so in a couple week can I PM u a link or should I jsut post it in the site check section.

I have been working 2 months straight on this thing so I would really like to know what you think.

mike

Thanks for the help…

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [February 11, 2004, 3:28pm UTC](https://forum.kirupa.com/t/applieing-sound-to-buttons-and-movieclips/42537/7 "2004-02-11T15:28:14Z")

</div>

Why not post it in Site Check so this entire forum can have a look at it ? 🙂
