It's probably a pathproblem. asfunction looks for the function on the same timeline as the textfield it is in. Regarding the textarea component that is the textarea component movieclip.
There are three ways to solve this:
1. Make myFunction a global function:
Code:
_global.myfunction = function(txt)
{
trace(txt);
}
2. Add _parent. to the functionname in the asfunction "adress":
Code:
textarea.text="<a href=\"asfunction:_parent.myfunction,foo\">testlink</a>"
3. Put mufunction on the component itself:
Code:
textarea.myfunction = function(txt)
{
trace(txt);
}
/Mirandir