Playing a sound when mc reaches a given position

i made a search but coudnt find any help. I want that a dragable mc plays a sound when it reaches a certain position _y>400.
Here’s the code i use, but without any results:

onClipEvent (mouseUp) {
&nbsp &nbsp &nbsp &nbsp if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
&nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp this.stopDrag(true);
&nbsp &nbsp &nbsp &nbsp }
&nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp if (this._y>400) {
&nbsp &nbsp &nbsp &nbsp }

i have a sound at frame label “som”
Any ideas?

The label som is INSIDE the movie clip or OUTSIDE ??
pom 0]


Then you should write

 if (this._y>400) {

pom 0]

sorry but doesnt work either…

Where is located the sound is the question… In a movie clip ? In the main timeline ??
pom 0]
Or you can send me your fla [email protected], but I’d rather you found it by yourself.

the sound is in a frame in the main timeline

OK, stupid of me… _root.gotoAndStop (“som”);

hihi, I forgot about those “”
pom 0]

now it works, with a little flaw: only plays the sound once; if i drag the clip around, it plays the first time that’s there, but not anymore…
how can i turn that around?

It should work everytime you unclick your mouse (onclipeven mouseup)… Hard to say just like this.

pom 0]

now it works because i made gotoAndPlay, instead