Subj : Calling a function within an object To : netscape.public.mozilla.jseng From : meisterderdinge@gmx.net (Zaph) Date : Mon Mar 01 2004 06:40 am Hi, I am new to Javascript and Spidermonkey, and encountered a little problem. I have following code in a script: var save; var yyy; function add2(x) { return x+1; } function add(x) { y = add2(x); return y + 1; } function xxx(v1,v2,v3) { this.v1 = v1; this.v2 = v2; this.v3 = v3; } function test(x) { save = add(x); return save; } add.prototype.add2 = add2; xxx.prototype.add = add; yyy = new xxx("111", "222", "333"); I compile it, evaluate it and then call test from c++ via "JS_CallFunctionName", and that works fine. As far as i know the instance of xxx is being generated at the evaluation part of the script. And therefore the functions "add" and "add2" are created as well. What I need to know now, is how to call "xxx.add" and "xxx.add.add2" from C++. I need to do this directly and without other functions (i.e. calling the functions inside the script). Your experience and guidance would be very much appreciated. Zaph .