The following example shows how you can set the button repeat interval on a Flex Gumbo FxNumericStepper control by setting the repeatInterval style on the nested increment button and decrement button.
Full code after the jump.
To use the following code, you must have Flash Player 10 and a Flex Gumbo SDK installed in your Flex Builder 3. For more information on downloading and installing the Gumbo SDK into Flex Builder 3, see “Using the beta Gumbo SDK in Flex Builder 3″.
<?xml version="1.0" encoding="utf-8"?>
<!-- http://blog.flexexamples.com/2009/03/02/setting-the-repeat-interval-on-an-fxnumericstepper-control-in-flex-gumbo/ -->
<FxApplication name="FxNumericStepper_repeatInterval_test"
xmlns="http://ns.adobe.com/mxml/2009"
backgroundColor="white">
<Style>
FxNumericStepper #incrementButton,
FxNumericStepper #decrementButton {
repeatInterval: 500;
}
</Style>
<FxNumericStepper id="numericStepper"
horizontalCenter="0"
verticalCenter="0" />
</FxApplication>
You can also set the repeatInterval style using ActionScript, as seen in the following example:
<?xml version="1.0" encoding="utf-8"?>
<!-- http://blog.flexexamples.com/2009/03/02/setting-the-repeat-interval-on-an-fxnumericstepper-control-in-flex-gumbo/ -->
<FxApplication name="FxNumericStepper_repeatInterval_test"
xmlns="http://ns.adobe.com/mxml/2009"
backgroundColor="white">
<Script>
private function init():void {
numericStepper.incrementButton.setStyle("repeatInterval", 500);
numericStepper.decrementButton.setStyle("repeatInterval", 500);
}
</Script>
<FxNumericStepper id="numericStepper"
horizontalCenter="0"
verticalCenter="0"
creationComplete="init();" />
</FxApplication>
This entry is based on a beta version of the Flex Gumbo SDK and therefore is very likely to change as development of the Flex SDK continues. The API can (and will) change causing examples to possibly not compile in newer versions of the Flex Gumbo SDK.
