Method from passed Variable?

Hi all,

Having a little bother trying to call a method as defined elsewhere. I have a class Reactor that has public methods A and B and I want an intermediary call (Remoting) to turn the string of the method into well… actually calling it.

I have tried

React.**strMethod**(var1)

and

["React."+**strMethod**+"(var1)"]

and

React.[**strMethod**](var1)

and some other variations on the square brackets, they do nothing mostly, a few variations throw errors.

I then moved to trying getDefinitionByName()


var *oRef *= getDefinitionByName(**strMethod**)
React.*oRef*(var1)

But these give “Variable TargetMethod not declared” etc.

So I also tried


var *oRef:Function *= getDefinitionByName(**strMethod**) as Function
React.*oRef*(var1)

and also with ‘Class’ instead of Function.

Nothing seems to work :frowning:

To clarify, the call works if i just have it statically written, just not dynamically passed. Could anyone shine a ray of light onto this for me please? Eval seems so simple!