Jump to content

Uncaught Type Error Problem


Recommended Posts

Hello, i can not figure out the simple problem here: 

Quiz.Game = function(game) {counter = 0;}Quiz.Game.prototype = {create: function() {button = this.add.sprite(100, 100, 'playbutton');button.inputEnabled = true;button.events.onInputDown.add(this.buttonDown, {num: 1});},buttonDown: function(num){counter++;console.log(counter);this.loadHighscores();},loadHighscores: function(){console.log('loadHighscores');}};

It throws the error: 


Uncaught TypeError: this.loadHighscores is not a function


What the **** is wrong with this.loadHighscores(); ? :)



Link to comment
Share on other sites


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...