HTML5 canvas score counter
Good evening again! In the current project I am working I need a simple score counter.
I have created a simple asc3 score couter with the following code:
stop();
var total:int=0;
scoreText.text = total.toString();
upbutton.addEventListener(MouseEvent.CLICK, fl_MouseClickHandler);
function fl_MouseClickHandler(event:MouseEvent):void
{
total = total+1;
scoreText.text = total.toString();
}
downbutton.addEventListener(MouseEvent.CLICK, fl_MouseClickHandler_2);
function fl_MouseClickHandler_2(event:MouseEvent):void
{
total = total-1;
scoreText.text = total.toString();
}
And I try to remake it in html5 canvas. I did the following code:
this.stop();
var total int=0;
this.scoreText.text = total.toString();
/* Mouse Click Event
this.upbutton_button.addEventListener("click", fl_MouseClickHandler.bind(this));
function fl_MouseClickHandler()
{
this.total = total+1;
this.scoreText.text = total.toString();
}
this.downbutton_button.addEventListener("click", fl_MouseClickHandler_2.bind(this));
function fl_MouseClickHandler_2()
{
this.total = total-1;
this.scoreText.text = total.toString();
}
And of course it does not work! Can you please help to understand where are the mistakes? The console of chrome gives the following:

Please help if you know how to proceed.
