[...arguments, argsCount, functionName] → [returnValue]
0x3d
2+ → 1
5
ActionCallFunction executes a function. The function can be an ActionScript built-in function (such as parseInt), a user-defined ActionScript function, or a native function. For more information, see ActionNewObject.
Field | Type | Comment |
---|---|---|
ActionCallFunction | ACTIONRECORDHEADER | ActionCode = 0x3D |
ActionCallFunction does the following:
Pops the function name (String) from the stack.
Pops numArgs (int) from the stack.
Pops the arguments off the stack.
Invokes the function, passing the arguments to it.
Pushes the return value of the function invocation to the stack.
If no appropriate return value is present (that is, the function does not have a return statement), a push undefined message 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).