thank you ryan for your insight on bindAsEventListener(this).

thats exactly what was required.

as for your thoughts on encapsulation, im on your side,
im an avid believer in proper OOP design principles,
however i have ofter found it hard to translate the style
or OOP from java, python and the like to javascript.

from alot of what i have read, classes are a fickle thing in
javascript.
very hard to find decent reading material.

On Nov 22, 6:32 am, xzyfer <[EMAIL PROTECTED]> wrote:
> i solved the problem about an hour ago, you were correct though.
> since v1.6 there is auto binding, meaning $
> ('some_element').observe('event', handler);
> automatically sets 'this' to the referencing object, in this case $
> ('some_element').
>
> the way i fixed it was to go back to the traditional Event.observe($
> ('some_element'),'event', function(event) { handler(event); } );
> so no binding is neccessary, its not all that elegant, but i couldnt
> manage to pass the event to my handler directly with wrapping it in
> the anonymous function.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Spinoffs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to