1 Reply Latest reply on Nov 7, 2012 10:11 AM by joel_pau

    calling a function twice by clicking once?


      I encountered a strange behavior in calling a function residing in stage level.


      I have a following code to call a function on click:


      rightBtnElement.bind ("click",function(){swapContent("right");});


      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.