Extending Flash |
|
|
|
| C-Level Extensibility > The C-level API > JSBool JS_DefineFunction() | |||
JSBool JS_DefineFunction(unsigned short *name, JSNative call, unsigned int nargs)
Method; registers a C-level function with the JavaScript interpreter in Flash. After the JS_DefineFunction() function registers the C-level function that you specify in the call argument, you can invoke it in a JavaScript script by referring to it with the name that you specify in the name argument. The name argument is case-sensitive.
Typically, this function is called from the MM_Init() function, which Flash calls during startup.
unsigned short *name, JSNative call, unsigned int nargs
name argument is the name of the function as it is exposed to JavaScript.call argument is a pointer to a C-level function. The function must return a JSBool, which indicates success or failure.nargs argument is the number of arguments that the function expects to receive.A Boolean value: JS_TRUE indicates success; JS_FALSE indicates failure.
|
|
|
|