I have some code that looks like this...
Thing function () {
var img = new Image;
DoSomeStuff function() {
//Code here that relies on my image being loaded...
};
InitMe function(src) {
this.img.onLoad = this.DoSomeStuff;
this.img.src = src;
};
}
var Test = new Thing();
Test.InitMe("some string");
The issue here is that this.DoSomeStuff
becomes img.DoSomeStuff
instead of Thing.DoSomeStuff
What I'm trying to figure out is how to call the Thing.DoSomeStuff()
function from img.onLoad
....