Subj : Re: Calling a function within an object To : netscape.public.mozilla.jseng From : meisterderdinge@gmx.net (Zaph) Date : Tue Mar 02 2004 07:22 am Well, It may have not been quite clear what I was intending to do, so changed I my code (and removed some bugs in the process): var save; function n2(v) { this.v = v; function add(x) { return x + 1; } this.add = add; } function n1(v) { this.v = v; this.sub = new n2("2"); var xx; /////////////////////// function add2(x) { return this.sub.add(x) + 1; } function add(x) { return x + 1; } ////////////////////// this.add2 = add2; this.add = add; } root = new n1("1"); function test(x) { save = root.add(x); return save; } And the problem is this: Using "JS_CallFunctionName", I can call "test" (which calls "root.add") from C++, but I cannot call "root.add" directly from C++. If I try to do this I always get "[object Object]" as a result. .