Skip navigation
Currently Being Moderated

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

Sep 20, 2012 7:35 PM

 
Replies
  • Currently Being Moderated
    Sep 20, 2012 7:35 PM   in reply to Community Help

    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.

     

     

     

     

     

     

     
    |
    Mark as:
  • kglad
    72,199 posts
    Jul 21, 2002
    Currently Being Moderated
    Sep 20, 2012 9:28 PM   in reply to the0bot

    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.

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 2, 2013 8:21 PM   in reply to Community Help

    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?

     

     
    |
    Mark as:
  • kglad
    72,199 posts
    Jul 21, 2002
    Currently Being Moderated
    Apr 3, 2013 8:31 AM   in reply to David_Wu

    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.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points