Simply place those two lines in a function that's attached to the page's onload event, therefore the mouse events will only be caught once everything is initialized.

On 10/4/06, Muskel A <[EMAIL PROTECTED]> wrote:

Heya
I'm making a class which does a thing or two:)

Inside my initialize function I have the following lines of code:

this.eventMouseMove = this.mouseMove.bindAsEventListener(this);
Event.observe(document.body , 'mousemove', this.eventMouseSelect);

And of course a function named mouseMove;

The problem is that I'm getting tons of '$A is not defined' if I move
my mouse while loading the page. The class is initialized on onload.
The class works just fine after the page finished loading. I tried
moving the two lines of code around to different places in my page. But
nothing helps.

Annyone out there know what I'm doing wrong?



--
Ryan Gahl
Application Development Consultant
Athena Group, Inc.
Inquire: 1-920-954-9798 x2903
Blog: http://www.someElement.com
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to