# Attaching a sound to a sprite with conditions

**URL:** <https://forum.kirupa.com/t/attaching-a-sound-to-a-sprite-with-conditions/320694>\
**Category:** design\
**Created:** [March 30, 2011, 4:13pm UTC](https://forum.kirupa.com/t/attaching-a-sound-to-a-sprite-with-conditions/320694 "2011-03-30T16:13:27Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Cookabarra](https://avatars.discourse-cdn.com/v4/letter/c/cdc98d/32.png) [@Cookabarra](https://forum.kirupa.com/u/Cookabarra)\
**Post date:** [March 30, 2011, 4:13pm UTC](https://forum.kirupa.com/t/attaching-a-sound-to-a-sprite-with-conditions/320694/1 "2011-03-30T16:13:27Z")

</div>

Hi All

Im making a jigsaw for kids in director and I would like a sound to play when two images are in the correct position

I have 20 sprites that all have a script like the following to make them click into position.

on mouseUp me  
if sprite(23).locV\<(422) then  
if sprite (23).locV\>(362) then  
if sprite(23).locH\<(134) then  
if sprite(23).locH\>(74) then  
sprite(23).loc = point (104,392)  
sprite(23).moveableSprite = FALSE  
end if  
end if  
end if  
end if  
end

There are 20 words and 20 images. For example when the picture of a cat is in place and the word cat is too I want to trigger the sound of a cat. Is this possible and Im going to put a counter on the puzzle as well so when all the pieces are in place an animation will be triggered

Barra
