i am trying to load a sound and play it when two nape bodies collide i have the collision detection working but cant play the sound the error is coming from the following code:
var collisionSound:Sound;
collisionSound = new Sound();
collisionSound.addEventListener(Event.COMPLETE, onSoundLoaded);
collisionSound.load(new URLRequest("bang.mp3"));
private function onSoundLoaded(e:event):void
{
collisionSound.play();
}
i have sample code in another script very similar to this thaat works help would be greatly appreciated.