13 Replies Latest reply on Jun 10, 2009 8:53 AM by kglad

    using onRelease to add to a variable

    chewbears Level 1

      Could not get what I wanted when searching this so I have to post another simple question that this morning I can't figure out

       

      var add1:Number = 0;

      trace(add1);
      if(add1 = 100){
      thTX._visible = false;
      }
      plus.onRelease = function(){
      add1 = add1 + 25;
      }

       

      I would like everytime "plus" is pressed to add 25 to variable.  So trace starts with 0 and after 4 clicks it ='s 100.

       

      THe above is not adding anything.