1 Reply Latest reply on Apr 22, 2015 1:46 PM by seano2o7

    count up code

    macsavant

      I found some code last week that counted up from 1 to whatever and it worked last week. when I opened the file up today adobe edge it says the file was created by a previous version of adobe edge and will be renamed "updated". Now the code I had that was working isn't working anymore.

       

      here was the code. can someone give me code that just counts up from 1?

       

      var counter_delay = 34;

      var max_count = 45;

      var present_count = 0;

       

      var timer = window.setInterval(stepUp,counter_delay);

      function stepUp(){

      present_count++;

      // Change the text of an element

      sym.$("Text").html(present_count);

      if(present_count==max_count)

      clearInterval(timer);

      }

        • 1. Re: count up code
          seano2o7 Level 3

          Hi,

           

          I've tested the code in my Edge and it works fine. It sounds like you've updated to a newer version of Edge and some Edge files break after being upgraded. However I'm running the new version of Edge and your code runs fine so just copy the original code into your new edge projects compositionReady

           

          var counter_delay = 34;

          var max_count = 45;

          var present_count = 0;

           

          var timer = window.setInterval(stepUp,counter_delay);

          function stepUp(){

          present_count++;

          // Change the text of an element

          sym.$("Text").html(present_count);

          if(present_count==max_count)

          clearInterval(timer);

          }

           

          and make sure the text element is named "Text" and it should work fine.