# Sounds?

**URL:** https://forum.kirupa.com/t/sounds/185642
**Category:** Uncategorized
**Created:** [April 14, 2006, 9:21pm UTC](https://forum.kirupa.com/t/sounds/185642 "2006-04-14T21:21:42Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![Robin105](https://avatars.discourse-cdn.com/v4/letter/r/5e9695/32.png) [@Robin105](https://forum.kirupa.com/u/Robin105)
#### Post date: [April 14, 2006, 9:21pm UTC](https://forum.kirupa.com/t/sounds/185642/1 "2006-04-14T21:21:42Z")

</div>

How can i make it so that when u press A, a sound will play

---

<div class="post-metadata">

### Author: ![hybrid101](https://avatars.discourse-cdn.com/v4/letter/h/7993a0/32.png) [@hybrid101](https://forum.kirupa.com/u/hybrid101)
#### Post date: [April 15, 2006, 3:40am UTC](https://forum.kirupa.com/t/sounds/185642/2 "2006-04-15T03:40:49Z")

</div>

the easiest way i know is to import the sound in a movie clip and give it an instance name sound(example: sound)  
put a stop action in the first frame of the movie clip  
then make a button and copy paste this:  
on(release){  
\_root.sound.play();  
}

---

<div class="post-metadata">

### Author: ![scotty](https://avatars.discourse-cdn.com/v4/letter/s/91b2a8/32.png) [@scotty](https://forum.kirupa.com/u/scotty)
#### Post date: [April 15, 2006, 8:13am UTC](https://forum.kirupa.com/t/sounds/185642/3 "2006-04-15T08:13:14Z")

</div>

[http://kennybellew.com/tutorial/](http://kennybellew.com/tutorial/)

scotty(-:

---

<div class="post-metadata">

### Author: ![vintage](https://avatars.discourse-cdn.com/v4/letter/v/e68b1a/32.png) [@vintage](https://forum.kirupa.com/u/vintage)
#### Post date: [April 15, 2006, 8:40am UTC](https://forum.kirupa.com/t/sounds/185642/4 "2006-04-15T08:40:13Z")

</div>

```auto

onEnterFrame = function () {
	if (Key.isDown(65)) {
		thing = new Sound();
		thing.attachSound("sound.wav");
		thing.start();
	}
};

```

You have to export “sound.wav” for actionsript

---

<div class="post-metadata">

### Author: ![TheCanadian](https://avatars.discourse-cdn.com/v4/letter/t/67e7ee/32.png) [@TheCanadian](https://forum.kirupa.com/u/TheCanadian)
#### Post date: [April 15, 2006, 9:10am UTC](https://forum.kirupa.com/t/sounds/185642/5 "2006-04-15T09:10:40Z")

</div>

> [@scotty](#):
>
> [http://kennybellew.com/tutorial/](http://kennybellew.com/tutorial/)
> 
> scotty(-:

Combine that with the Key class and you have what you’re after:

```auto
var snd:Sound = new Sound(this);
snd.attachSound("mySound");
Key.addListener(snd);
snd["onKeyDown"] = function ():Void {
 if (String.fromCharCode(Key.getCode()) == "A") {
  this.start();
 }
};

```

:hoser:

---

<div class="post-metadata">

### Author: ![Robin105](https://avatars.discourse-cdn.com/v4/letter/r/5e9695/32.png) [@Robin105](https://forum.kirupa.com/u/Robin105)
#### Post date: [April 23, 2006, 3:17am UTC](https://forum.kirupa.com/t/sounds/185642/6 "2006-04-23T03:17:50Z")

</div>

I tried the one that looked simple  
on(release){  
\_root.sound.play();  
}

But the only problem is that when i click on the button it wont play … Do i have to do somethign with the linkage or something,  
also i read the Tuts but it didnt help as much as u guys did \>.\<

---

<div class="post-metadata">

### Author: ![hybrid101](https://avatars.discourse-cdn.com/v4/letter/h/7993a0/32.png) [@hybrid101](https://forum.kirupa.com/u/hybrid101)
#### Post date: [April 23, 2006, 5:55am UTC](https://forum.kirupa.com/t/sounds/185642/7 "2006-04-23T05:55:50Z")

</div>

did you put the sound into the movieclip?  
maybe you missed the instance name. it worked fine for me  
btw, make it on(press)  
😉

---

<div class="post-metadata">

### Author: ![Robin105](https://avatars.discourse-cdn.com/v4/letter/r/5e9695/32.png) [@Robin105](https://forum.kirupa.com/u/Robin105)
#### Post date: [April 23, 2006, 8:28pm UTC](https://forum.kirupa.com/t/sounds/185642/8 "2006-04-23T20:28:47Z")

</div>

Yes i put the sound on a movieclip, should i delete the movie clip?

---

<div class="post-metadata">

### Author: ![hybrid101](https://avatars.discourse-cdn.com/v4/letter/h/7993a0/32.png) [@hybrid101](https://forum.kirupa.com/u/hybrid101)
#### Post date: [April 24, 2006, 4:06am UTC](https://forum.kirupa.com/t/sounds/185642/9 "2006-04-24T04:06:04Z")

</div>

oh f\*\*\*, i got it all wrong. i though A was a button:(  
follow the advice of the guys above:)  
follow vintage’s example:)
