1 Reply Latest reply on May 15, 2013 9:00 AM by resdesign

    click counter function

    UmbertoPandini

      Good morning

      I created a little video game in Edge.

      Now I have to count clicks on certain areas.

      Where do I enter this function?

       

       

      var clicks = 0;

      puntoClick function () {

           clicks + = 1;

           document.getElementById ("clicked"). value = clicks;

           if (clicks === 1) {

         alert ("1 point")

      }

      }

       

       

      If I put the Stage (creationComplete) when the call to click:

       

       

      sym.puntoClick ();

       

       

      does not work ...

       

       

      I assigned the 'ID "clicked" inside the area with sym.puntoClick ();