Pause, stop and play audio actionscript

im trying to make a play,** pause** and stop btns controlling a mp3 file which is in the library which has a linkage id of **Speakers **
ive manage to get the pause and play to work but now incorperating a stop button isnt working for me

var snd:Sound = new Sound();
btnHalt.onRelease = function() {
btnResume.onRelease = function() {
  snd.start(snd.position / 1000);
restartbtn.onRelease = function() {

ive also looked into the O’Reilly one to

but i still dont think even that will help me i think i need some kinda if statement?

to say basicly if you have pressed the pause btn, then the play btn, play from state pause at, but if you have pressed the stop btn then pressed the play btn, play from start and also if the play btn has been pressed and the audio is playing if pressed again dont play again do nothing.