Hi!
One of these days someone helped me about how to pass external arguments to timed events this way:
this.value1 = "foo";
this.value2 = "bar";
this.mytimedevent = this.time.addEvent({
delay: 1000,
callback: DoSomething,
args:[this.value1,this.value2],
callbackScope: this,
repeat: 0
});
Now I would like to know how to do this for click events, passing the loop control var value as argument (something similar to this):
for (var a=1;a<=3;a++) {
this["btnAnswer"+a].on('pointerup', (e) => {
this.DoSomething(a);
});
}
Any clue???
Thanks!