I suggest doing `var scope = this;` right after `this.load = function(url, loadedCB) {` and use `scope.animations` instead of `self.animation`.