You need to start learning action scripting. When it comes to flash buttons, three places you should go.
1. The Macromedia Flash Manual or Help File if for some reason the manual is not available...
Tutorials are bountiful, and what you are looking for are simply the very basics of Flash. stop();, play();, goto(), etc. are simple foundations.