Subj : Re: Calling a function from a different scope under Rhino To : netscape.public.mozilla.jseng From : "Kok Hoor" Date : Wed Dec 03 2003 09:35 am Hi Igor. Thanks for the reply. Thanks a lot. Apparently it works, after I turned off dynamic scopes. This way, whenever I get an object from a different scope, it is executed in that scope. Just hope that I don't need to use dynamic scoping from the global scope. Regards, Kok Hoor "Igor Bukanov" wrote in message news:3FCAE1CF.9000705@fastmail.fm... > Kok Hoor wrote: > > > > I am creating a shared scope object that hosts system functions. It > > is also primarily used to share variables and functions across different > > windows. > > > > Next, for each opened windows, I created a scope for them individually. > > This way, scripts parsed are not directly accessible from other scopes. > > > > My problem is, sometimes we need to access child windows to access > > their properties and invoke their method. This was ok with Mozilla or > > Internet Explorer, as I can get a reference to a window I create > > (var wnd = window.open(...);), and access the variables and the methods as > > well. > > > > This is different in Rhino however, although I can access their > > variables, > > invoking a child method runs the method in the caller's scope, not the child > > scope. Is there any way to implement this? > > See documentation about dynamic scopes at > http://www.mozilla.org/rhino/scopes.html > > Regards, Igor > .