I am aware of this site not working properly. I am working on it!
v0.4.6.0 beta

How to attach as an event handler a class method, and making sure that when I use the this in the event handler it will point to the class, and not to the DOM element I have attached the event to?


You need to "bind" the event handler to the Object you want it to run under. Basically, you are adding it again as a method to the class.
In the code it will look like that:

var X=new Class({
    initialize: function(){
    str: 'I am a property of THIS object',
        alert(this.str);//will alert "I am a property of THIS object"




click me!