onEvent triggered multiple times after screen reload

The project: (Moderator: Project removed by original poster’s request)

Game 1: score grow in relation to screen reload times (adding 1 point each correct click in the first try, 2 in the second, 3 in the third…), rather than a stable 1 point. Target code is line 36 to 104.
The problem seems to be around onEvent() being triggered multiple times. I think the issue is related to event propagation. Is there a preventDefault() in applab?

Similiar post on stack overflow: https://stackoverflow.com/questions/25264726/why-is-the-onclick-event-triggered-twice/25264804

Nevermind. The student found a bug in one onEvent brackets - if you are having this problem please

  1. Go back and check all onevent() 's “});” is in the right place;
  2. move unnecessary stuff in onEvent() to a separate function.

Thanks so much for posting that followup in case anyone else had the same issue! Thoughtful of you. :slight_smile:

1 Like