3 Replies Latest reply on Jul 20, 2009 12:32 PM by kglad

    AS2 TextInput Background Color - Issues when trying to change dynamically

    szodjo

      Hello,
      I'm having issues changing a TextInput background color after the initial onLoad using AS2.

      On load, I have no issues setting the background color with this code:

      Code:
      onClipEvent (load) {
          this.background = true;
          this.backgroundColor = 0x1E1C1C;
      }

      However, I have a form validator run when focus is lost but yet I cannot set the background color at that point. For example, I'm trying to set the background color to orange and text to white if the field's contents are invalid. Even something simple like this doesn't affect the colors.

      Code:
      on (focusOut) {
              this.backgroundColor = 0xFAA523;
              this.borderColor = 0xFAA523;
              this.borderStyle = "solid";
              this.color = 0xFFFFFF;
              this.text = 'Enter your first name';
      }

      All code is in actions for the TextInput itself.

      Anyone know what I'm doing wrong?

      Thanks in advance!