[Proto-Scripty] Re: Prototype Class, Event Listeners and Referencing Self

2010-07-21 Thread T.J. Crowder
Hi, I agree, I think it's much clearer now. The unofficial wiki is going to be folded into prototypejs.org content eventually, once A) It's dead easy to post prototypejs.org content (something that Tobie's been working on; he may be done now, I haven't checked lately), and B) I have a bit of time

Re: [Proto-Scripty] Re: Prototype Class, Event Listeners and Referencing Self

2010-07-21 Thread Guillaume Lepicard
Hi TJ, Thanks for pointing this ! When I first read the API doc (in the "old" format), explanations were not that clear or i misunderstoos them ; but then looking in the new API doc, it's much more clear ; and thanks for the proto-scripty.wikidot.com

[Proto-Scripty] Re: Prototype Class, Event Listeners and Referencing Self

2010-07-21 Thread T.J. Crowder
Hi Guillaume, Just #bind is sufficient. You almost never need #bindAsEventListener: http://proto-scripty.wikidot.com/prototype:tip-you-probably-don-t-need-bindaseventlistener -- T.J. :-) On Jul 21, 10:18 am, Guillaume Lepicard wrote: > Hi, you need to bind the listener function to your object:

[Proto-Scripty] Re: Prototype Class, Event Listeners and Referencing Self

2010-07-21 Thread T.J. Crowder
Hi, If you really want `takeAction` to be a public property on the instance, you typically use Function#bind for this; example in the docs: http://api.prototypejs.org/language/function/prototype/bind/ Basically, Function#bind creates a function that, when called, will turn around and call the ori