5 Replies Latest reply on Feb 25, 2010 2:54 PM by kglad

    Problem With Health Bar

    TheBrody

      I'm trying to make a health bar, it does down when you press a button. I used a timer. But it doesn't clear the timer, it just keeps on going.


      on(release){

       

          function countdown(){
         
          _root.BarM._visible = true;   
          _root.BarM.BarP._width -= 2;
          _root.BarM.BarP._x -= 1;
              if (_root.BarM.BarP._width <= 0){
                  _root.BarM._visible = false;
                  _root.BarM.BarP._width = 270;
                  _root.BarM.BarP._x = 0;
                  MLevel + 1;
                  clearInterval(TimeBar)
              }
                 
             
          }
         
          TimeBar = new setInterval(countdown, 10);
      }