Changing value of a Numeric Stepper
I am a newbie to Flex and programming. I am trying something where I have 2 开发者_运维问答Numeric Steppers. One numeric stepper holds values from 0-230 and the other from 0.00-0.99. My question is how to change the value of the first numeric stepper when the second numeric stepper goes from 0.99 to 0.00. Suppose the first numeric stepper has a value 10 and the second numeric stepper is being incremented continuously. As it reaches 0.99 and on mouse up on the up arrow, 10 should change to 11 and this numeric stepper goes to 0.00.
Could anyone help me out with some code or suggestion?
Thanks is advance, REDDY
One of the solutions:
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical">
<mx:NumericStepper minimum="0.00" maximum="1" value="0.98" stepSize="0.01" change="check_step()" id="stepper1"/>
<mx:NumericStepper value="10" maximum="230" stepSize="1" id="stepper2"/>
</mx:Application>
Script:
private function check_step():void{
if (stepper1.value == 1){
stepper1.value = 0;
stepper2.value = stepper2.value+1;
}
}
精彩评论