# Playing a sound on entering a frame/label

**URL:** <https://forum.kirupa.com/t/playing-a-sound-on-entering-a-frame-label/268434>\
**Category:** flash\
**Created:** [August 13, 2008, 8:20pm UTC](https://forum.kirupa.com/t/playing-a-sound-on-entering-a-frame-label/268434 "2008-08-13T20:20:53Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pixelmech](https://avatars.discourse-cdn.com/v4/letter/p/df788c/32.png) [@Pixelmech](https://forum.kirupa.com/u/Pixelmech)\
**Post date:** [August 13, 2008, 8:20pm UTC](https://forum.kirupa.com/t/playing-a-sound-on-entering-a-frame-label/268434/1 "2008-08-13T20:20:53Z")

</div>

I’ve got a file with say 5 sections, each section with a frame label. When I enter a section, I want to play a sound. It should happen when the movie hits that frame label/frame. I’ve tried this:

```auto
 
onEnterFrame = function () {
 snd = new Sound(this);
 snd.attachSound("space");
 snd.start(0, 1);
};

```

It works in that the sound plays, but then it goes on forever. I believe it’s actually playing on every single frame after it starts. My guess is I am using the wrong event handler?

How can I modify this so when the frame is entered, the sound begins and plays once, and then its over?
