You haven't read the API well enough then. Separate files essentially
mean very, very little.

You need to keep a reference to the function that you set on the
observer. What's important to realise here is that in javascript you
have instances of functions, in exactly the same way as you might have
an instance of a class in OOP. So you have something like:

function foo()
{...}

var fooInst = foo;
element#observe('event', fooInst);
element#stopObserving('event', fooInst);

as long as the fooInst variable is global, ie, referencable by any
javascript anywhere, it doesn't matter where you stop observing it
from.

Also, I believe in the latest version of prototype that:
element#stopObserving()
with no parameters, stops all observers on that element.

On Sep 20, 8:48 am, Cristisor <[EMAIL PROTECTED]> wrote:
> I already read the api but I have a problem: the observers are set in
> the AutoSuggest.js file and I need to stop observing them in a
> function located in another file. And in the api page they say that I
> have to use stopObserving the same way observe is used and they give
> an example that doesn't work, and inside the AutoSuggest.js the code
> is written exactly the same way. Maybe someone knows another way: what
> I do is to create an autosuggest variable like this:
> var auto = new AutoSuggest(url, parameters). Can I destroy this
> variable and also destroy the autosuggest?
>
> On Sep 19, 11:38 pm, bluezehn <[EMAIL PROTECTED]> wrote:
>
> > look at api, it's always a good place to look for when you want to...
> > um... refer to the application programming 
> > intercacehttp://www.prototypejs.org/api/event/stopObserving
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to