Changing from a onRelease (for example) event to a function is pretty simple.
Code:
play_btn.onRelease = function() {
gotoAndStop(10);
}
Keep all actionscript in it's own layer and not on the button itself.
So create a movie clip that will act as your button, give it an instance name and then with dot notation, append the action onRelease or whatever to the button name
play_btn.onRelease
then define the function... see example above.
Start with something very simple and easy... all by itself in a new Flash doc.
Create a button in frame one along with a stop(); and then in a separate layer put in the function actionscript.
Do a simple gotoAndStop in frame 10 or so... in frame 10 put a big blue box.
Once you verify that your function is working, then adapt into your real project.
Best wishes,
Adninjastrator