Basic function help

Aiight - I’ve decided to turn my sloppy Flash techniques around and start writing everything in Actionscript and not attach actions to objects.

How do I go about turning this into a proper function?

onClipEvent (enterFrame) {
if (rwd) {
this.prevFrame();
}
}

it is going on a MC named ‘more_info’.

¡GRACIAS!