1 Reply Latest reply on Oct 25, 2007 12:43 PM by Noah_B

    Actionscript advice needed

    chris_le_sueur
      right, i know there is a lot of code pasted here but ive cut out the bits that dont need changing!!
      basically im stuck on this now, i have a motion detection actionscript program running and counting the number of pixels with movement in them...

      the timer now works and only certain movie clips are used at certain times, however i want to reset the 'count' variable so that it starts counting from 0 again when a new minute is started...

      How can I reset the counter for each time period? or how could I put in a new variable for each time period?


      var count = 0;
      var my_date: Date = new Date();

      function snap() {
      // code cut down
      var nine = 0;
      var total = 0;
      // code cut down
      if (d>tolerance) {

      count = count+1;
      nine = count;
      ten = count;
      total = count;
      // code cut down
      }
      }
      }
      var my_date: Date = new Date();


      if (my_date.getMinutes() == 24) {

      if (nine>50) {
      mc_nine.gotoAndStop(2);
      if (nine>100) {
      mc_nine.gotoAndStop(3);
      if (nine>150) {
      mc_nine.gotoAndStop(4);
      if (nine>200) {
      mc_nine.gotoAndStop(5);
      if (nine>250) {
      mc_nine.gotoAndStop(6);
      }
      }
      }
      }
      }
      }
      if (my_date.getMinutes() == 25) {

      if (ten>50) {
      mc_ten.gotoAndStop(2);
      if (ten>100) {
      mc_ten.gotoAndStop(3);
      if (ten>150) {
      mc_ten.gotoAndStop(4);
      if (ten>200) {
      mc_ten.gotoAndStop(5);
      if (ten>250) {
      mc_ten.gotoAndStop(6);
      }
      }
      }
      }
      }
      }
      if (count>0) {
      total = count;
      trace(total);
      }
      updateAfterEvent();
      before = now.clone();
      }