Im having trouble reaching my object from a nested function. Ill just go right ahead and show the code.
function ChartObject(parent){
this.CANVAS = document.createElement('canvas');
parent.appendChild(this.CANVAS);
this.CANVAS.addEventListener('mousemove', function(evt){
var ctx = this.CANVAS.getContext("2d");//cannot access the CANVAS like this
//do stuff
}, false);
}
Ok so my problem is i cannot access the canvas object from the line: var ctx = this.CANVAS.getContext("2d");//cannot access the CANVAS like this