try the pass event.
startMove: function(el){
el.addEvent('mousemove', this.move.pass([el, event]));
},
Fábio Miranda Costa
Engenheiro de Computação
http://meiocodigo.com
On Mon, Jul 6, 2009 at 7:11 PM, Ryan Florence <[email protected]> wrote:
>
> So I've got this stuff in a class
>
> startMove: function(el){
> el.addEvent('mousemove',this.move(el,event));
> },
>
> move: function(el,event){
> el.setStyles({
> 'left': event.page.x-(el.getSize().x/2),
> 'top': event.page.y-(el.getSize().y/2)
> });
> },
>
> stop: function(el){
> el.removeEvent('mousemove',this.move);
> }
>
> But it doesn't work ... Result of expression 'event' [undefined] is not an
> object.
>
> I know there's a syntax thing going on here. How do I send that event
> object into the move function?
>
> I had this working when the whole move function's code was nested inside
> the startMove function. But then I couldn't remove the event.
>
> Thanks!
>
> Ryan Florence
> http://ryanflorence.com/blog/
>