For the code below, I am getting the following error on the second line of the GameStatsPanel function:
"Uncaught TypeError: Object #Timer has no method 'start'"
I'm really quite confused why this is happening - I have a feeling I'm missing something simple somewhere but I need enlightened. Feel free to check out the issue by going to www.letsplayglobalgames.com and selecting the 'Play!' option from the homepage. Let me know if you need more details.
function GameStatsPanel() {
this.timer = new Timer();
this.timer.start(); /* error is thrown here */
}
function Timer() {
this.container = document.getElementById('game_time');
this.current_flag_time_start;
this.current_flag_time_stop;
this.time_start = new Date();
this.time_stop;
this.time_difference;
this.current_flag_time_difference;
}
Timer.prototype.start = function() {
this.current_flag_time_start = new Date();
}
new GameStatsPanel()