Extending Flash |
|
|
|
| C-Level Extensibility > The C-level API | |||
The C-level extensibility API consists of the JSBool (*JSNative) function signature and the following functions:
JSBool JS_DefineFunction() unsigned short *JS_ValueToString() JSBool JS_ValueToInteger() JSBool JS_ValueToDouble() JSBool JS_ValueToBoolean() JSBool JS_ValueToObject()JSBool JS_StringToValue()JSBool JS_DoubleToValue() JSVal JS_BooleanToValue() JSVal JS_BytesToValue() JSVal JS_IntegerToValue() JSVal JS_ObjectToValue() unsigned short *JS_ObjectType() JSObject *JS_NewArrayObject() long JS_GetArrayLength() JSBool JS_GetElement() JSBool JS_SetElement() JSBool JS_ExecuteScript() Method; describes C-level implementations of JavaScript functions in the following situations:
cx pointer is a pointer to an opaque JSContext structure, which must be passed to some of the functions in the JavaScript API. This variable holds the interpreter's execution context.obj pointer is a pointer to the object in whose context the script executes. While the script is running, the this keyword is equal to this object.argc integer is the number of arguments being passed to the function.argv pointer is a pointer to an array of jsval structures. The array is argc elements in length.rval pointer is a pointer to a single jsval structure. The function's return value should be written to *rval.The function returns JS_TRUE if successful; JS_FALSE otherwise. If the function returns JS_FALSE, the current script stops executing and an error message appears.
|
|
|
|