javascript variable scope across functions jQuery involved
<p>Here is what i cannot get to work - in mouseMove this.mouseX is undefined. I need the mouseX and mouseY (e.pageX in code) from mousemove event.</p>

<pre><code>function myClass () {
    var mouseX=x;
    var mouseY=y;
    $(document).mousemove(this.mouseMove);
}
myClass.prototype.mouseMove = function(e){
    this.mouseX=e.pageX;//not a good idea but you can alert this
}
var a=new myClass();
</code></pre>

<p>Can i get that event passed to the supposed class instance or there is no way to get it done?</p>

<p>I should also mention i am trying to avoid global scope variables here.</p>
