beautypg.com

Jsval js_objecttovalue(), Unsigned short *js_objecttype(), Jsobject *js_newarrayobject() – Adobe Extending Flash Professional CS5 User Manual

Page 562

background image

540

EXTENDING FLASH PROFESSIONAL

C-Level Extensibility

Last updated 5/2/2011

Returns
A

JSVal

structure that contains the integer that passed to the function as an argument.

JSVal JS_ObjectToValue()

Usage

jsval JS_ObjectToValue(JSObject *obj);

Description
Method; stores an object return value in a

JSVal

. Use

JS_NewArrayObject()

to create an array object; use

JS_SetElement()

to define its contents.

Arguments

JSObject

*obj

The obj argument is a pointer to the

JSObject

object that you want to convert to a

JSVal

structure.

Returns
A

JSVal

structure that contains the object that you passed to the function as an argument.

unsigned short *JS_ObjectType()

Usage

unsigned short *JS_ObjectType(JSObject *obj);

Description
Method; given an object reference, returns the class name of the object. For example, if the object is a DOM object, the
function returns "

Document

". If the object is a node in the document, the function returns "

Element

". For an array

object, the function returns "

Array

".

Note: Do not modify the returned buffer pointer, or you might corrupt the data structures of the JavaScript interpreter.

Arguments

JSObject

*obj

Typically, this argument is passed in and converted using the

JS_ValueToObject()

function.

Returns
A pointer to a null-terminated string. The caller should not free this string when it finishes.

JSObject *JS_NewArrayObject()

Usage

JSObject *JS_NewArrayObject(JSContext *cx, unsigned int length [, jsval *v])

Description
Method; creates a new object that contains an array of

JSVals

.

This manual is related to the following products: