Subj : Re: Scoping question To : netscape.public.mozilla.jseng From : Marcello Bastea-Forte Date : Tue Jan 13 2004 11:35 am > I'd like each of the final two bits of script to be able to use the > first global function and variable, but only see it's own version of > MyOtherFunc and Var. I don't want two totally separate sets of script > - I only want to define and run MyFunc once, since it may do something > very time consuming. Hope that makes some sense :) Assuming you now have something along the lines of: function Object1() { this.Var = 0; this.MyOtherFunc = MyOtherFunc; } You could change it to: function Object1() { this.Var = 0; this.MyOtherFunc = function() { Var = SomeGlobalVar * 2; } } That way the function is defined directly in the object, and you don't need to worry about name collisions (or doing something like function Object1_MyOtherFunc()). That's how I see it anyway. Marcello .