I am not sure you can extend something to do this. However I looked a little
but into the numeric stepper class and it is in there this private function:
/**
* @private
* Increase/decrease the current value.
*/
private function buttonPress(button:Button, trigger:Event = null):void
{
if (enabled)
{
// we may get a buttonPress message before focusOut event for
// the text field. Hence we need to check the value in
// inputField.
takeValueFromTextField();
var oldValue:Number = lastValue;
setValue(button == nextButton ?
lastValue + stepSize :
lastValue - stepSize, true, trigger);
if (oldValue != lastValue)
inputField.selectRange(0,0);
}
}
You copy the class rename it and use it as your own custom class. In here you
add your check if the button is the next button and the value > 100 and try to
disable the next button. Please have a further look into the class there might
be a better place where you can put your code ...
HTH,
Claudiu
________________________________
From: Eric Dunn <[email protected]>
To: [email protected]
Sent: Fri, January 8, 2010 5:08:56 PM
Subject: Re: [flexcoders] NumericStepper override class
Let me explain further.
I have several of numeric steppers (this number will vary) that will need to
total 100. So I have a method that adds the numeric steppers and sets to a
variable. I then want to check that variable and disable the up arrow on the
steppers if the value is >= 100, so that the only option is to move a value
down.
Eric W Dunn
Adaption Technologies
281-465-3326
ed...@adpt-tech. com
----- Original Message -----
From: "claudiu ursica" <the_braniak@ yahoo.com>
To: flexcod...@yahoogro ups.com
Sent: Friday, January 8, 2010 3:33:53 AM
Subject: Re: [flexcoders] NumericStepper override class
Do you need to disable it for the whole range of numbers or just for some of
them ?
C
________________________________
From: Eric Dunn <ed...@adpt-tech. com>
To: flexcoders <flexcod...@yahoogro ups.com>
Sent: Thu, January 7, 2010 11:43:03 PM
Subject: [flexcoders] NumericStepper override class
I have the need to disable the up arrow and/or down arrow on a series of
numericSteppers ..
I believe I will need to create a new class that extends the NumericStepper
class. I have studied the numericStepper class and not sure what I need to
override or exactly what needs to written.
Any advice or a direction to look at to assist me?
Eric W Dunn
Adaption Technologies
281-465-3326
ed...@adpt-tech. com