3 Replies Latest reply on Apr 12, 2007 8:14 AM by kglad

    Limit total value for dynamic text

    yellowfry
      Hi,

      I've got two buttons: one which increases the value of a dynamic text box by 1, and one which decreases the same text by 1. I need to set a limit on the value of the dynamic text box, to -35 to +35.

      The code I've got so far:

      //set inital value of text box
      trial1_txt.text = 0;

      //control the increase button
      this.Increase_btn.onPress = function(){
      trial1_txt.text++;
      }

      //control the decrease button
      this.Decrease_btn.onPress = function(){
      trial1_txt,text--;
      }

      Any help would be greatly appreciated! I'm SOOOOO stuck on this one!

      Thanks!