if you experiment with this code you can get it:

onClipEvent (load) {
mySound=new Sound()
mySound.attachSound( "snd" )
mySound.setVolume( 100 )
mySound.start( 0, 999 )
}

onClipEvent (enterFrame) {
gap= Math.abs ( _parent._xmouse - _x );
mySound.setVolume(100-(gap/4));
trace (mySound.getVolume());
}

eg try changing gap/4 to gap/5 or gap/3 or whatever until you like the result.
[Edited by gaz_b on 09-09-2002 at 02:12 AM]