4 Replies Latest reply: Apr 3, 2013 8:31 AM by kglad RSS

    NumericStepper - Adobe ActionScript® 3 (AS3 Flex) API Reference

    community help Community Member
        • 1. Re: NumericStepper - Adobe ActionScript® 3 (AS3 Flex) API Reference
          the0bot Community Member

          I seem to be encountering problems with numeric stepper values over several billion. It is hard to say where the exact break line is, but I have suddenly begun receiving bug reports from users who are  'winning the resource wars' in my application.

           

          City has 120Bn gold, 7bn food, 600M wood, 600m stone, 700m iron

          1: Clean open of the0bot

          2: Wait a few mins for everything to process

          3: open TB5

          4: values auto displayed in gold window are: -429129244    (s/b 0)

          5: Click "Clear", "Refresh"

          6: Gold now cleared but this displayed in Food: 1448289086   

          7: NB: No troops have been selected yet

           

          There are 5 steppers in a group, the individual limit for any control is variable, set by the formula

          control.maximum = (totalGroup.maximum - totalGroup.value)  + component.value)

           

          Since the practical limit in the application is actually  999,999,999 I can modify the code to work, but the API says: Maximum value of the NumericStepper. The maximum can be any number, including a fractional value.

           

           

           

           

           

           

          • 2. Re: NumericStepper - Adobe ActionScript® 3 (AS3 Flex) API Reference
            kglad ACP/MVP

            make sure you are trying to assign a number to your stepper, not a string like 999,999,999 (or anything else that contains a comma).

             

            you can assign fractional values your stepper but that will be rounded to a whole number unless you assign a fractional stepSize to your stepper.

            • 3. Re: NumericStepper - Adobe ActionScript® 3 (AS3 Flex) API Reference
              David_Wu

              Here is the issue: when set value outside of the range and click a “submit” button, the value is automatically changed and submitted. And customer complains they even do not realize it’s out of range and there should be an error message to remind them.

              But I found it’s hard to handle it.

              Do you have any suggestion on that?

               

              • 4. Re: NumericStepper - Adobe ActionScript® 3 (AS3 Flex) API Reference
                kglad ACP/MVP

                you can use the testField property of the numeric stepper class to access changes to the textinput component part of the stepper.

                 

                you can use a stepper listener like focusin (and a loop) or focusout to check for changes to the textField of the stepper and display warnings and/or reset the textField's text property.