I encountered a strange behavior in calling a function residing in stage level.
I have a following code to call a function on click:
it calls a following function:
and |I also created a left button then put the following code directly to the btn symbol with onClick:
what's strange about this is that the right button gets registered twice, so the variable "counter" increments by 2. but the left button gives only 1 to the variable "counter". then I created a setTimeout to call swapContent("right"), or swapContent("left") for that matter, it also increments by 2.
I hope I'm doing something wrong instead of it being a bug. any help is much appreciated.
I tested your code:
var counter = 0;
It increments by 1.