Copy link to clipboard
Copied
Heya, new to working in adobe animate, and i'm trying to, as the title says, make an incremental game with Animate. I'm new and don't know much about coding, so I was asking how to make it so when i push my button (let's say Button1), it starts adding 1 to a points counter infinitely while also removing the button from the scene? i'm in HTML5 Canvas if it helps. thanks in advance!
Copy link to clipboard
Copied
this.cnt=0;
this.yourcountertextfield.text=this.cnt;
this.btn.addEventListener("click", counterF.bind(this));
function counterF(){
this.cnt++;
this.yourcountertextfield.text=this.cnt
}
Copy link to clipboard
Copied
Sorry for the late answer, but its not quite what i'm looking for. From what I understand, this would simply add 1 to the cnt variable when btn is clicked, but I need it to start adding 1 to that variable every second.
Copy link to clipboard
Copied
then use a timer (eg, setInterval).