For example, I have a function in class A:
private function functionA(f:Function):void
{
var objB:B;
objB.f();
}
Is there a way to pass a non-static public member function of class B as a parameter to functionA? (from inside class A, of course)
I know such syntax exists in c++, but not sure if you can do this in flex/as3
Sure:
The instance associated with the function is carried with it. If you need to call the function on a different instance call
f.apply(instance, [1, "hi"])AS3 has no concept of delegates or function-signatures-as-a-type so you’ll need to know the arguments to pass in.