3/28/2011 4:09:16 AM
Title:
Setting Numeric Stepper Value
Hello.
I am using Numeric stepper in my component.
I am having following concept,
when i press the downbutton of Numeric Stepper and when it comes to maximum value, again the value of Numeric Stepper comes to 0
Like when maximum value is 60, then after 60 it will come to minimum value say 0 . roundwise
Plase Help me in that
3/31/2011 5:06:28 AM
if(event.target.value == -1 || event.target.previousValue < -1){
event.target.value = 59;
}else if(event.target.value == 60 || event.target.nextValue > 60){
event.target.value = 00;
}
3/31/2011 5:10:49 AM
<mx:Script>
<![CDATA[
private function changeMinStepper(event:NumericStepperEvent):void{
if(event.target.value == -1 || event.target.previousValue < -1){
event.target.value = 59;
}else if(event.target.value == 60 || event.target.nextValue > 60){
event.target.value = 00;
}
}
]]>
</mx:Script>
<mx:NumericStepper maximum="60" minimum="-1" maxChars="2" change="changeMinStepper(event)"/>
4/18/2011 10:54:38 PM
Thanks Buddy...!
Its working....
Thanks to AskMeFlash.com
4/18/2011 11:04:36 PM
It can be done with one property also "allowValueWrap = true/false" of Numeric Stepper
AskMeFlash Rocks