Hello,
****************
function myClass(name) {
this.name=name;
}
myClass.prototype.printName=function(evt) {
try {
if (evt.which==1 || evt.button==1)
document.write('Mr '+this.name);
}
catch (e) {
document.write('Sorry, what is your name?');
}
}
var myObj=myClass('Jhons');
var clickme=document.getElementById('clickme');
clickme.addEvent(clickme,'mousedown',myObj.printNa me);
****************
When clicking, I get always: "Sorry, what is your name?"..
Consider myObj is not a singleton, and I'm adding the same function to
many elements as event listeners.
How can I get the expected name, when used as event handler?
-thanks, Eli