# Attaching sound effect

**URL:** <https://forum.kirupa.com/t/attaching-sound-effect/301215>\
**Category:** Uncategorized\
**Created:** [December 5, 2009, 7:14am UTC](https://forum.kirupa.com/t/attaching-sound-effect/301215 "2009-12-05T07:14:51Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![spellbound55](https://avatars.discourse-cdn.com/v4/letter/s/779978/32.png) [@spellbound55](https://forum.kirupa.com/u/spellbound55)\
**Post date:** [December 5, 2009, 7:14am UTC](https://forum.kirupa.com/t/attaching-sound-effect/301215/1 "2009-12-05T07:14:51Z")

</div>

Hi, I’m making a basic side scrolling platform game. I want a little death sound to play when the main sprite falls off a cliff and exceeds a certain coordinate, but I dont know any actionscript for attaching sound files. The sound file in the library is called “DeathNote”.

heres the working death script attached to the sprite:

if (this.\_y\>450.0 && !dead){  
dead = true;  
trace (“you died!”);  
gotoAndPlay(“death”, 1);  
}

all it needs is the sound… Now what??

thanks!
