PDA

View Full Version : playing a sound when mc reaches a certain position


rfl
04-01-2002, 11:24 AM
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) {
if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
this.stopDrag(true);
}
if (this._y>400) {
this.gotoAndStop(som);
}
}
---------------------------------
i have a sound at frame label "som"
Any ideas?

farafiro
04-01-2002, 11:49 AM
go to the library
chose your sound
right click> linkage> export this sympol as // give a name
and

if (this._y>=400) {
mySound = new Sound
mySound.attachSound("the name goes here") // don't 4get the ""
mySound.start(0,1) // 0 is to start after 0 seconds and 1 is to play once
}


remove the old sound's frame (com)

rfl
04-01-2002, 12:37 PM
perfect!
thank you