MACROMEDIA FLASH 8-EXTENDING FLASH Manual page 543

Extending flash
Table of Contents

Advertisement

typedef JSBool (*JSNative)(JSContext *cx,
JSObject *obj, unsigned int argc, jsval *argv, jsval
*rval)
Description
Method; describes C-level implementations of JavaScript functions in the following
situations:
The
pointer is a pointer to an opaque
cx
some of the functions in the JavaScript API. This variable holds the interpreter's
execution context.
The
pointer is a pointer to the object in whose context the script executes. While the
obj
script is running, the
The
integer is the number of arguments being passed to the function.
argc
The
pointer is a pointer to an array of
argv
in length.
The
pointer is a pointer to a single
rval
should be written to
The function returns
, the current script stops executing and an error message appears.
JS_FALSE
JSBool JS_DefineFunction()
Usage
JSBool JS_DefineFunction(unsigned short *name, JSNative call, unsigned int
nargs)
Description
Method; registers a C-level function with the JavaScript interpreter in Flash. After the
JS_DefineFunction()
argument, you can invoke it in a JavaScript script by referring to it with the name that you
specify in the
argument. The
name
Typically, this function is called from the
during startup.
keyword is equal to this object.
this
.
*rval
if successful;
JS_TRUE
function registers the C-level function that you specify in the
argument is case-sensitive.
name
MM_Init()
structure, which must be passed to
JSContext
structures. The array is
jsval
structure. The function's return value
jsval
otherwise. If the function returns
JS_FALSE
function, which Flash calls
elements
argc
call
The C-level API
543

Advertisement

Table of Contents
loading

This manual is also suitable for:

Flash 8

Table of Contents