This content has been marked as final. Show 5 replies
I think that you might need to extend the NumericStepper class, and disable its private property inputField (which is the TextInput it uses).
Thanks for the response... Do you have any examples of how I would go about doing this? I've looked around and haven't found how to extend components.
Ok i made a quick example and it worked so here it is. First create a new class that extends from NumericStepper:
package test //you should change this for a package of your own, this is a test only
import mx.core.mx_internal ;
use namespace mx_internal;
public class NumStep extends NumericStepper
public function disableTextInput():void
inputField.enabled = false;
Once you have this, on you main application or wherever you are adding this NumericStepper do this:
<local:NumStep id="myNumStep" creationComplete="myNumStep.disableTextInput()"/> //change local for whatever namespace you are using
And there you go, now you have a numericStepper whose textInput is disabled, so you can only use the buttons to change its value.
There's a document called "Creating and Extending Flex 2 Components", there you will find all the info you need on extending components
Hope this helps you out, try it out and let me know if it works
I put the code in from your example and it worked perfect. This should allow me to do what I need. I'm wondering... How did you find the property inputField on the numericStepper control? I may modify the class you made for other custom components.
Thanks for your help
When you install FDS you have access to the source code of it, so all i did was to check the NumericStepper.as file and there i found the inputField property.
Glad i could help :) don't forget to mark this and your other topic as answered