# Very noobish question(dont laugh), how to use sounds?

**URL:** <https://forum.kirupa.com/t/very-noobish-question-dont-laugh-how-to-use-sounds/260331>\
**Category:** programming\
**Created:** [May 14, 2008, 2:35pm UTC](https://forum.kirupa.com/t/very-noobish-question-dont-laugh-how-to-use-sounds/260331 "2008-05-14T14:35:55Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![bluemagica](https://avatars.discourse-cdn.com/v4/letter/b/a4c791/32.png) [@bluemagica](https://forum.kirupa.com/u/bluemagica)\
**Post date:** [May 14, 2008, 2:35pm UTC](https://forum.kirupa.com/t/very-noobish-question-dont-laugh-how-to-use-sounds/260331/1 "2008-05-14T14:35:55Z")

</div>

Actually i dont have any idea how to make sounds work with movieclips, and how to control them via AS(AS2), so please give me all the resources tutorial and help you can about using sounds and controlling them via code.

In this case however i need to play a small sound on hitTest with a movieclip, how do i do that exactly?

Offtopic: what will be a good place to get some roalty free sounds for background music and effects?

---

<div class="post-metadata">

**Author:** ![Jephz](https://avatars.discourse-cdn.com/v4/letter/j/58956e/32.png) [@Jephz](https://forum.kirupa.com/u/Jephz)\
**Post date:** [May 14, 2008, 3:06pm UTC](https://forum.kirupa.com/t/very-noobish-question-dont-laugh-how-to-use-sounds/260331/2 "2008-05-14T15:06:16Z")

</div>

Heres my way:

First import the sound into your library (duh)

Now right-click on it, select Linkage, check the Export for AS2/AS3 option and type in your Linkage Name

Go back to your stage, select a frame and right-click for Actions

Type in this code:

var btnsound = new Sound();  
btnsound.attachSound(“yoursoundslinkagename”)

Now, if you want to play this sound when the user rolls over a button do this:

on(rollOver) {  
\_root.btnsound.start(0,1)  
}

This is play the sound once. If you want to loop the sound, just change the 1 into how many times you want looped. Obviously, you can change the rollOver option for almost anything. Hope this helps

PS: [Flashkit.com](http://Flashkit.com) or Sounddogs have really good sound banks.

---

<div class="post-metadata">

**Author:** ![sekasi](https://avatars.discourse-cdn.com/v4/letter/s/5f8ce5/32.png) [@sekasi](https://forum.kirupa.com/u/sekasi)\
**Post date:** [May 14, 2008, 4:06pm UTC](https://forum.kirupa.com/t/very-noobish-question-dont-laugh-how-to-use-sounds/260331/3 "2008-05-14T16:06:29Z")

</div>

If you don’t want to have it exported in the first frame (crap for preloader) uncheck that checkbox in linkage and have it play on a intermediary unused frame as “event”

```auto
on(rollOver) {
_root.btnsound.start(0,1)
}

```

Try to avoid using Actionscript 1 and \_root though 😛

---

<div class="post-metadata">

**Author:** ![bluemagica](https://avatars.discourse-cdn.com/v4/letter/b/a4c791/32.png) [@bluemagica](https://forum.kirupa.com/u/bluemagica)\
**Post date:** [May 14, 2008, 4:33pm UTC](https://forum.kirupa.com/t/very-noobish-question-dont-laugh-how-to-use-sounds/260331/4 "2008-05-14T16:33:05Z")

</div>

All problems are solver thanks to both of you!!..now, a bit of topic, i need some sound effects, can you please help me search for it?  
telephone ringing-- "tring trrring"  
Slob — as if a wet cloth struck something  
And a dissolving sound when changing scenes.—“shooosh”

If you find a link for this, please provide it.

---

<div class="post-metadata">

**Author:** ![Jephz](https://avatars.discourse-cdn.com/v4/letter/j/58956e/32.png) [@Jephz](https://forum.kirupa.com/u/Jephz)\
**Post date:** [May 15, 2008, 1:11am UTC](https://forum.kirupa.com/t/very-noobish-question-dont-laugh-how-to-use-sounds/260331/5 "2008-05-15T01:11:57Z")

</div>

As I said, you should try Flashkit or Sounddogs, but heres a few sounds you mentioned:

Telephone Rings:

[http://flashkit.com/search.php?cat=soundfx&per=10&page=1&term=Telephone](http://flashkit.com/search.php?cat=soundfx&per=10&page=1&term=Telephone)

Scene Change:

[http://www.flashkit.com/soundfx/Interfaces/Zoops/vwoom-Public\_D-148/index.php](http://www.flashkit.com/soundfx/Interfaces/Zoops/vwoom-Public_D-148/index.php)

[http://www.flashkit.com/soundfx/Interfaces/Zoops/Vwoom-Public\_D-218/index.php](http://www.flashkit.com/soundfx/Interfaces/Zoops/Vwoom-Public_D-218/index.php)

Thats all I can find for now.

---

<div class="post-metadata">

**Author:** ![bluemagica](https://avatars.discourse-cdn.com/v4/letter/b/a4c791/32.png) [@bluemagica](https://forum.kirupa.com/u/bluemagica)\
**Post date:** [May 16, 2008, 4:19pm UTC](https://forum.kirupa.com/t/very-noobish-question-dont-laugh-how-to-use-sounds/260331/6 "2008-05-16T16:19:22Z")

</div>

Ok now i have another problem…

I have a background sound that i want to play throughout the game, but i want to lower its volume during the gameplay. I got it to work this far…but then,when i try to set the volume of my bullet sound bullet.setVolume(20); the background sound also gets set to 20…how can i change only one sound’s volume?

---

<div class="post-metadata">

**Author:** ![neilmmm](https://avatars.discourse-cdn.com/v4/letter/n/ee7513/32.png) [@neilmmm](https://forum.kirupa.com/u/neilmmm)\
**Post date:** [May 16, 2008, 9:33pm UTC](https://forum.kirupa.com/t/very-noobish-question-dont-laugh-how-to-use-sounds/260331/7 "2008-05-16T21:33:39Z")

</div>

when you declare a sound attach it to a timeline (a movieclip)

var btnsound = new Sound(this\_mc);

if you do not put anything between the brackets it attaches it to main time line

when you lower the volume all sounds in one timeline are effected

i personnally createempty movie clips to hold all my sounds

try [http://kennybellew.com/tutorial/](http://kennybellew.com/tutorial/) for all sound advice
