1 Reply Latest reply on Apr 4, 2010 6:21 PM by kglad

    numericStepper - How to modify borderColor and show decimals?

    JWPB

      Hello,

      Two questions concerning the numericStepper component and I think they both have to do with how to access the textfield part of the component.

       

      1. How do you change the color of the textfield border in the numericStepper component.

       

      2. I'm using the numericStepper to step up/down by increments of .25 (25 cents) and would like it to always show 2 decimals. But when it reaches a whole number (like 25) it will not show the 2 decimals. Do I treat this like a textfield to force the text to have 2 decimals? And if so, how do I access the .text?

       

      Using ActionScript 2 - Flash.

       

      Thank you,

      J

        • 1. Re: numericStepper - How to modify borderColor and show decimals?
          kglad Adobe Community Professional & MVP

          1.  your stepper has a textfield (inputField) you can address.

           

          2.  you can use a change listener:

           

          var lo:Object = {};
          lo.change = function(eobj:Object){
              var nS:String = eobj.target.value.toString();
              if(nS.indexOf(".")==-1){
                  eobj.target.inputField.text = nS+".00";
              } else if(nS.indexOf(".")==nS.length-2){
                  eobj.target.inputField.text = nS+"0";
              }
          }
          yourstepper.addEventListener("change",lo)