Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
Thios is the Using the Community forum (which is the forum for issues using the forums).
Please tell us what Adobe application you are using so that this can be moved to the proper forum for help.
Copy link to clipboard
Copied
Sorry, I did not see that. The Animate CC and the HTML5 canvas