CallMethod
[...arguments, argsCount, methodName, object] → [returnValue]

Adobe documentation

ActionCallMethod

ActionCallMethod pushes a method (function) call onto the stack, similar to ActionNewMethod.

FieldTypeComment
ActionCallMethodACTIONRECORDHEADERActionCode = 0x52

If the named method exists, ActionCallMethod does the following:

  1. Pops the name of the method from the stack. If the method name is blank or undefined, the object is taken to be a function object that should be invoked, rather than the container object of a method. For example, if CallMethod is invoked with object obj and method name blank, it's equivalent to using the syntax:
obj();

If a method’s name is foo, it's equivalent to:

obj.foo();
  1. Pops the ScriptObject, object, from the stack.
  2. Pops the number of arguments, args, from the stack.
  3. Pops the arguments off the stack.
  4. Executes the method call with the specified arguments.
  5. Pushes the return value of the method or function to the stack. If no appropriate return value is present (the function does not have a return statement), a push undefined is generated by the compiler and is pushed to the stack. The undefined return value should be popped off the stack.

For all of the call actions (ActionCallMethod, ActionNewMethod, ActionNewObject, and ActionCallFunction) and initialization actions (ActionInitObject and ActionInitArray), the arguments of the function are pushed onto the stack in reverse order, with the rightmost argument first and the leftmost argument last. The arguments are subsequently popped off in order (first to last).