Subj : Newbie Rhino Question To : netscape.public.mozilla.jseng From : ryan u Date : Sat Jul 23 2005 07:24 am Hello, I have some newbie questions. I am trying to create instances of scriptable objects with rhino for functions and then call functions defined within those functions through the scriptable object. Here is my jscript testFunction = function(){ test = function(){ return "Hello"; } var testVar = 5; testFunction.prototype = { visit: function(){ return "Hello2"; } } } I would like to create a javascript object with rhino for testFunction and then call test, get testVar and call visit. I am loading this script with evaluateReader and am creating a scriptable object and trying to call the function test like this. // this line seems to work. I get back a NativeObject. Scriptable newScope = currentContext.newObject(this,"testFunction"); // This returns a UniqueTag of 1 Object func = newScope.get("test",this); // This is not a function. if(func instanceof Function){ Function f = (Function)func; Object result = f.call(currentContext, newScope, newScope, new String[]{}); return Context.toString(result); } Also how would I call visit? Any suggestions? Ryan .