Subj : about defining object... To : netscape.public.mozilla.jseng From : celleris@naver.com (Youngsun Jeong) Date : Tue Sep 30 2003 05:44 am Hello, I want to use "plusAge" (that is custom js function) in following script. please see the following script in svg file.. First, I defined JSClass "myobject" . See below; JSClass my_class = { "myobject", 0, JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, JS_FinalizeStub, JSCLASS_NO_OPTIONAL_MEMBERS }; Next, I add JSFunction "my_plusAge()" to my_class. "my_plusAge()" is ; static JSBool my_plusAge(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) { jsval jsval_age = OBJ_GET_SLOT(cx, obj, JSSLOT_PRIVATE); int age = JSVAL_TO_INT(jsval_age); int added = JSVAL_TO_INT(argv[0]); int sum = age + added; *rval = INT_TO_JSVAL(sum); return JS_TRUE; } But.."my_plusAge" is not working. I want to know how do make the relation between "age" and "plusAge()". And how "myobject" is defined? Please help me! .