[...arguments, argsCount, methodName, object] → [returnValue]
- Action Code:
0x52
- Stack:
3+ → 1
- SWF version:
5
Adobe documentation
ActionCallMethod
ActionCallMethod pushes a method (function) call onto the stack, similar to ActionNewMethod.
Field | Type | Comment |
ActionCallMethod | ACTIONRECORDHEADER | ActionCode = 0x52 |
If the named method exists, ActionCallMethod does the following:
- 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();
- Pops the ScriptObject, object, from the stack.
- Pops the number of arguments, args, from the stack.
- Pops the arguments off the stack.
- Executes the method call with the specified arguments.
- 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).