PDA

View Full Version : how to add sound inside script??


rlee
11-29-2002, 07:37 AM
how could i add sound when ...

_root.onEnterFrame = function() {
if (_root.MC1.hitTest(_root.MC2)) {

// how could i play a sound file here?

mysound = new Sound();
mysound.play();

// something like this??

}
};

suppose the sound file in the library called myMusic...

:eek:

rlee
11-30-2002, 05:25 AM
i get it myself...
mySound = new Sound();
mySound.attachSound("myMusic");
mySound.start();