[Proto-Scripty] Re: this keyword inside of the map function

2009-08-26 Thread Daniel Rubin
Sent: Tuesday, August 25, 2009 3:06 AM To: prototype-scriptaculous@googlegroups.com Subject: [Proto-Scripty] Re: this keyword inside of the map function Andy Daykin wrote: The doSlide function was what I was referring to. I tried using TJ's suggestion of using this as the 2nd parameter

[Proto-Scripty] Re: this keyword inside of the map function

2009-08-26 Thread Andy Daykin
Thanks a lot! It's working perfectly now! -Andy -- From: Daniel Rubin dru...@dimedis.de Sent: Wednesday, August 26, 2009 3:01 AM To: prototype-scriptaculous@googlegroups.com Subject: [Proto-Scripty] Re: this keyword inside of the map function

[Proto-Scripty] Re: this keyword inside of the map function

2009-08-20 Thread Daniel Rubin
Andy Daykin wrote: Hello, I am having some difficulties writing a class, in my code I have a class where I need to be able to bind event listeners to values. In my code I want the variable pointerIndex to be accessible outside of the initialize function, but right now it is not. If I make

[Proto-Scripty] Re: this keyword inside of the map function

2009-08-20 Thread T.J. Crowder
Hi, Rather than binding it, use the second parameter to map (aka collect [1]), that's what the second param (context) is for. You'll find that most of the Enumerable methods that take callbacks also take a context parameter so the callback can be a method. [1]

[Proto-Scripty] Re: this keyword inside of the map function

2009-08-20 Thread Andy Daykin
. Crowder t...@crowdersoftware.com Sent: Thursday, August 20, 2009 3:56 AM To: Prototype script.aculo.us prototype-scriptaculous@googlegroups.com Subject: [Proto-Scripty] Re: this keyword inside of the map function Hi, Rather than binding it, use the second parameter to map (aka collect [1

[Proto-Scripty] Re: this keyword inside of the map function

2009-08-19 Thread Kevin Porter
I am not positive, but I believe the problem is from my event listeners on the line: Now: $(e).observe('click', *this*.doSlide.bind(featuresWrapper[i].id)); You need to pass 'this' as the first argument to bind(). regards, - Kev -- Kevin Porter Advanced Web Construction Ltd

[Proto-Scripty] Re: this keyword inside of the map function

2009-08-19 Thread Andy Daykin
-scriptaculous@googlegroups.com Subject: [Proto-Scripty] Re: this keyword inside of the map function I am not positive, but I believe the problem is from my event listeners on the line: Now: $(e).observe('click', *this*.doSlide.bind(featuresWrapper[i].id)); You need to pass