# Playing a sound on hittest

**URL:** <https://forum.kirupa.com/t/playing-a-sound-on-hittest/80068>\
**Category:** flash\
**Created:** [February 19, 2005, 12:30am UTC](https://forum.kirupa.com/t/playing-a-sound-on-hittest/80068 "2005-02-19T00:30:04Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![NintendoDs00000](https://avatars.discourse-cdn.com/v4/letter/n/4da419/32.png) [@NintendoDs00000](https://forum.kirupa.com/u/NintendoDs00000)\
**Post date:** [February 19, 2005, 12:30am UTC](https://forum.kirupa.com/t/playing-a-sound-on-hittest/80068/1 "2005-02-19T00:30:04Z")

</div>

Okay so i’m making this game, and I want it, so when the bar scrolls across the screen and hits the box it will play the sound inside the box mc.

The code I have inside the box with the sound is.

onClipEvent (enterFrame)  
{  
if (this.hittest(\_root.trackline))  
{  
this.gotoAndPlay(“sound”);  
} // end if  
}
