Conteo de click

Buenas tardes comunidad, quisiera saber si hay alguna forma de saber cuantos click dan al tratar de resolver un juego al estilo de donde esta waldo?
y se guarde un registro por usuario

The easiest non-code way to do this is to create a timeline that animates the inner text of a score box in steps. It would have a pause timeline action at each step. Then you can call a continue timeline action for that timeline to advance the score. Using a start timeline action would reset.

This has some issues like having a maximum cap as to what the score could be (as much as you animate) and might not be flexible for other reasons. JavaScript code may be a better solution. Some questions would be:

  • When do you need the data reset/how long should it be persisted? Do you just need it for a portion of a scene, do you need it to last for the length of a whole scene, do you need it to stay just when showing the .html page, or do you need it to persist beyond reloads/navigation?

  • What do you want to do with the data afterwards?

A basic javascript solution that just shows the click count would be setup via these steps:

  1. Create a text element with a Unique Element ID (in the Identity Inspector) of "score"
  2. For each guess, use an action set to Run JavaScript with code like:
    // advance the guess count
    if(window.guessCount == null) {
        window.guessCount = 0;
    }
    window.guessCount += 1;
    
    // show it in the score box
    hypeDocument.getElementById("score").innerHTML = "" + window.guessCount;
    
  3. If the guess is correct, you can run javascript that resets the score just like:
    // set the score back to 0
    window.guessCount = 0;
    
    // show it in the score box
    hypeDocument.getElementById("score").innerHTML = "" + window.guessCount;