If I have several buttons I make an array and use forEach() but I know others have different ways of doing it. This is for Animate HTML5/CANVAS.
// code in frame 1
var root = this;
function useButtons(button, t) {
button.addEventListener("click", answerQuestion.bind(this));
function answerQuestion() {
// your code here
}
}
[root.Btn1, root.Btn2, root.Btn3, root.Btn4, root.Btn5].forEach(useButtons);
... View more