How to assign a function with arguments into a variable?

Here’s my problem:

I need to assign this function:

var f2:Function = function(i:String){
trace("this is " + i);
}

into a separate variable… something like var testVar:Function = f2(“TestString”); This doesn’t work because f2(“TestString”) gets executed. Any way to make it work?

var testVar:Function = f2 will work if f2 is a function that takes no arguemnts… But how will i make it work for functions that take in arguements? I tried to search for the answer but to no avail >_<

Thanks =)

Sorry… I found the answer… >_< Please close this thread… ANyway, here’s the answer i found:

[COLOR=#000000][FONT=Times New Roman][LEFT][FONT=monospace][COLOR=#993300]function[/COLOR] addfunction[COLOR=#000000]([/COLOR]AFunc:[COLOR=#993300]Function[/COLOR], _param:[COLOR=#993300]String[/COLOR][COLOR=#000000])[/COLOR]
[COLOR=#000000]{[/COLOR]
[COLOR=#993300]trace[/COLOR][COLOR=#000000]([/COLOR][COLOR=#0000FF]"Function addfunction : AFunc = “[/COLOR] + AFunc + [COLOR=#0000FF]”[COLOR=#000099]** **[/COLOR]_param = "[/COLOR] + _param[COLOR=#000000])[/COLOR];
AFuncCOLOR=#000000[/COLOR];
[COLOR=#000000]}[/COLOR]

[COLOR=#993300]function[/COLOR] showmessageCOLOR=#000000[/COLOR]
[COLOR=#000000]{[/COLOR]
[COLOR=#993300]trace[/COLOR][COLOR=#000000]([/COLOR][COLOR=#0000FF]"Function showmessage : msg = "[/COLOR] + msg[COLOR=#000000])[/COLOR];
[COLOR=#993300]trace[/COLOR]COLOR=#000000[/COLOR];
[COLOR=#000000]}[/COLOR]

addfunction[COLOR=#000000]([/COLOR]showmessage, [COLOR=#0000FF]“hello”[/COLOR][COLOR=#000000])[/COLOR];[/FONT][/LEFT][/FONT][/COLOR]

from: http://www.actionscript.org/forums/showthread.php3?t=125939