I read this : http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/Function.html But that does not exactly correspond to what I want to do, and I can't find the right solution. However my question is not so complicated.
Here is the situation :
mains.as contains a functionA(strParam:String)
onlineClass.as contains a functionB working like this :
private static functionB (fnParam:Function):void //my fnParam is functionA
{
var strParam:String = getSomeStringResult();
//I have a result from a function
fnParam.call(strParam);
//I want to execute functionA with strParam as parameter
}
But I don't understand what I have to do with call parameters. I tried :
fnParam.call(null, strParam);
But it returns an error : [Fault] exception, information=TypeError: Error #1009: Impossible to access a property or a method of a null object's reference
I am sure the answer already exists somewhere but a search with "function" and "call" leads nowhere.
Thank you for the help.
functionBisfnParam(and you're passingfunctionA), then where are you gettingstrParamfrom? - Marcela