I am trying to assign an event handler to a class I have created in Mootools but I cannot seem to access any of the variables that I created for the class. Like so:
var newPerson = new Class({
initialize: function(name)
{
this.firstName = name;
//-------Creating Div----------//
...........
//--------Created Div----------//
$(this.newDiv.id).click(function()
{
alert("clicked");
};
};
Now when I change the function to alert the objects assigned name alert(this.firstName);
it doesn't access them and I can't figure out why.
Could anyone point my in the right direction?