Heres how you do it:
1) Create your own function. Add this script in your timeline:
var myOwnFunction:Function = function ( value:String ) {
trace ( value ); // sends "value" to the output window
}
2) Ensure you have enabled html for the text field you're using. Here's the script for the html text:
myTextField.htmlText = "<a href=\"asfunction:myOwnFunction, myValueHere\">Click this html asfunction link</a>";
When you test your movie, you should see the text field with the text "Click this html asfunction link". When you click on it, the output window will show "myValueHere" as a string.
Try it out.