# (F5) Button and sound help please

**URL:** <https://forum.kirupa.com/t/f5-button-and-sound-help-please/9419>\
**Category:** flash\
**Created:** [December 11, 2002, 1:51pm UTC](https://forum.kirupa.com/t/f5-button-and-sound-help-please/9419 "2002-12-11T13:51:02Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ToddziLLa](https://avatars.discourse-cdn.com/v4/letter/t/3be4f8/32.png) [@ToddziLLa](https://forum.kirupa.com/u/ToddziLLa)\
**Post date:** [December 11, 2002, 1:51pm UTC](https://forum.kirupa.com/t/f5-button-and-sound-help-please/9419/1 "2002-12-11T13:51:02Z")

</div>

(Flash 5)

Ok guys, I am trying to get a button to work by pressing keys.

Problem 1) I want the keys that are pressed to be `,1,2,3,etc… and those keys aren’t in Flash’s actions, can they still work? Or do I have to use keys like SPACE, RETURN, etc…???

Problem 2) Here is the code I’m using. I also want a sound to be played while the button is going down. The sound is in the “down” of the button, but I linked it. THe linkage name is “sound1” here is the code;

onClipEvent (enterFrame) {  
if(Key.isDown(Key.SPACE)){  
with (sound1) {  
play ();  
}  
}  
}

What is wrong?

Thanks

---

<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:** [December 11, 2002, 4:41pm UTC](https://forum.kirupa.com/t/f5-button-and-sound-help-please/9419/2 "2002-12-11T16:41:50Z")

</div>

eki’s answered q1 below

as regards sound - have you declared and populated a sound object e.g.

carol=new Sound();  
carol.attachSound(“harkTheHeraldAngelsSing”);  
carol.start();

where harkTheHeraldAngelsSing is the linkage name you applied to the sound in the library
