<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Flex Examples &#187; FxNumericStepper</title>
	<atom:link href="http://blog.flexexamples.com/category/spark/fxnumericstepper/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.flexexamples.com</link>
	<description>Just a bunch of Adobe Flex Examples</description>
	<lastBuildDate>Wed, 26 Jan 2011 18:09:51 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Formatting values in an FxNumericStepper control using a custom display format function in Flex Gumbo</title>
		<link>http://blog.flexexamples.com/2008/12/04/formatting-values-in-an-fxnumericstepper-control-using-a-custom-display-format-function-in-flex-gumbo/</link>
		<comments>http://blog.flexexamples.com/2008/12/04/formatting-values-in-an-fxnumericstepper-control-using-a-custom-display-format-function-in-flex-gumbo/#comments</comments>
		<pubDate>Fri, 05 Dec 2008 06:41:09 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[beta]]></category>
		<category><![CDATA[FxNumericStepper]]></category>
		<category><![CDATA[dataFormatFunction]]></category>
		<category><![CDATA[Gumbo]]></category>
		<category><![CDATA[needsSWF]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2008/12/04/formatting-values-in-an-fxnumericstepper-control-using-a-custom-display-format-function-in-flex-gumbo/</guid>
		<description><![CDATA[<p>The following example shows how you can format the value displayed in a Flex Gumbo FxNumericStepper control by setting a custom display format function using the displayFormatFunction property.</p> <p class="alert">The displayFormatFunction property was added in build 4228. <a href="http://opensource.adobe.com/wiki/display/flexsdk/Download+Flex+4">Download Adobe Flex Gumbo SDK</a>.</p> <p>Full code after the jump.</p> <p></p> <p>According to the [beta] documentation on [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can format the value displayed in a Flex Gumbo FxNumericStepper control by setting a custom display format function using the <code>displayFormatFunction</code> property.</p>
<p class="alert">The <code>displayFormatFunction</code> property was added in build 4228. <a href="http://opensource.adobe.com/wiki/display/flexsdk/Download+Flex+4">Download Adobe Flex Gumbo SDK</a>.</p>
<p>Full code after the jump.</p>
<p><span id="more-887"></span></p>
<p>According to the [beta] documentation on the <code>dataFormatFunction</code> property:</p>
<blockquote><p>
Callback function that formats the value displayed in the text input field. The function takes a single Number as an argument and returns a formatted String.</p>
<p>The function has the following signature:</p>
<pre class="code">
funcName(value:Number):String
</pre>
<p>The default value is <code>undefined</code>.
</p></blockquote>
<p class="alert">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 <a href="http://blog.flexexamples.com/2008/08/02/using-the-beta-gumbo-sdk-in-flex-builder-3/">&#8220;Using the beta Gumbo SDK in Flex Builder 3&#8243;</a>.</p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/FxNumericStepper_displayFormatFunction_test/bin/srcview/source/main_4235.mxml.html">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2008/12/04/formatting-values-in-an-fxnumericstepper-control-using-a-custom-display-format-function-in-flex-gumbo/ --&gt;
&lt;Application name="FxNumericStepper_displayFormatFunction_test"
        xmlns="http://ns.adobe.com/mxml/2009"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"&gt;

    &lt;Script&gt;
        &lt;![CDATA[
            private function numericStepper_dispFmtFunc(value:Number):String {
                return numFormatter.format(value);
            }
        ]]&gt;
    &lt;/Script&gt;

    &lt;Declarations&gt;
        &lt;NumberFormatter id="numFormatter" precision="2" /&gt;
    &lt;/Declarations&gt;

    &lt;!-- The displayFormatFunction property was added in build 4228. --&gt;
    &lt;FxNumericStepper id="numericStepper"
            minimum="0"
            maximum="10"
            value="5"
            stepSize="0.01"
            valueInterval="0.01"
            displayFormatFunction="numericStepper_dispFmtFunc" /&gt;

&lt;/Application&gt;
</pre>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/FxNumericStepper_displayFormatFunction_test/bin/srcview/index.html">View source</a> is enabled in the following example.</p>
<p><iframe src="http://blog.flexexamples.com/wp-content/uploads/FxNumericStepper_displayFormatFunction_test/bin/main_4235.html" width="100%" height="150"></iframe></p>
<p>Due to popular demand, here is the &#8220;same&#8221; example in a more ActionScript friendly format:</p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/FxNumericStepper_displayFormatFunction_test/bin/srcview/source/main2_4235.mxml.html">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2008/12/04/formatting-values-in-an-fxnumericstepper-control-using-a-custom-display-format-function-in-flex-gumbo/ --&gt;
&lt;Application name="FxNumericStepper_displayFormatFunction_test"
        xmlns="http://ns.adobe.com/mxml/2009"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"
        initialize="init();"&gt;

    &lt;Script&gt;
        &lt;![CDATA[
            import mx.components.FxNumericStepper;
            import mx.formatters.NumberFormatter;

            private var numFormatter:NumberFormatter;
            private var numericStepper:FxNumericStepper;

            private function init():void {
                numFormatter = new NumberFormatter();
                numFormatter.precision = 2;

                numericStepper = new FxNumericStepper();
                numericStepper.minimum = 0;
                numericStepper.maximum = 10;
                numericStepper.value = 5;
                numericStepper.stepSize = 0.01;
                numericStepper.valueInterval = 0.01;
                /* The displayFormatFunction property was added in build 4228. */
                numericStepper.displayFormatFunction = numericStepper_dispFmtFunc;
                addChild(numericStepper);
            }

            private function numericStepper_dispFmtFunc(value:Number):String {
                return numFormatter.format(value);
            }
        ]]&gt;
    &lt;/Script&gt;

&lt;/Application&gt;
</pre>
<p class="alert">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.</p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Formatting values in an FxNumericStepper control using a custom display format function in Flex Gumbo on FlexExamples.com',url: 'http://blog.flexexamples.com/2008/12/04/formatting-values-in-an-fxnumericstepper-control-using-a-custom-display-format-function-in-flex-gumbo/',contentID: 'post-887',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'dataFormatFunction,Gumbo,needsSWF',providerName: 'FlexExamples.com',styling: 'text' });return false" class="evernoteSiteMemoryLink"><img src="http://static.evernote.com/article-clipper-remember.png" class="evernoteSiteMemoryButton" />
				</a>				<div class="evernoteSiteMemoryClear">&nbsp;</div>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.flexexamples.com/2008/12/04/formatting-values-in-an-fxnumericstepper-control-using-a-custom-display-format-function-in-flex-gumbo/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Wrapping values on an FxNumericStepper control in Flex Gumbo</title>
		<link>http://blog.flexexamples.com/2008/11/17/wrapping-values-on-an-fxnumericstepper-control-in-flex-gumbo/</link>
		<comments>http://blog.flexexamples.com/2008/11/17/wrapping-values-on-an-fxnumericstepper-control-in-flex-gumbo/#comments</comments>
		<pubDate>Tue, 18 Nov 2008 05:34:04 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[beta]]></category>
		<category><![CDATA[FxNumericStepper]]></category>
		<category><![CDATA[Gumbo]]></category>
		<category><![CDATA[valueWrap]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2008/11/17/wrapping-values-on-an-fxnumericstepper-control-in-flex-gumbo/</guid>
		<description><![CDATA[<p>The following example shows how you can wrap values in a Flex FxNumericStepper control by setting the valueWrap property.</p> <p>Full code after the jump.</p> <p></p> <p class="alert">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 [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can wrap values in a Flex FxNumericStepper control by setting the <code>valueWrap</code> property.</p>
<p>Full code after the jump.</p>
<p><span id="more-867"></span></p>
<p class="alert">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 <a href="http://blog.flexexamples.com/2008/08/02/using-the-beta-gumbo-sdk-in-flex-builder-3/">&#8220;Using the beta Gumbo SDK in Flex Builder 3&#8243;</a>.</p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/FxNumericStepper_valueWrap_test/bin/srcview/source/main_4112.mxml.html">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2008/11/17/wrapping-values-on-an-fxnumericstepper-control-in-flex-gumbo/ --&gt;
&lt;Application name="FxNumericStepper_valueWrap_test"
        xmlns="http://ns.adobe.com/mxml/2009"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"&gt;

    &lt;ApplicationControlBar dock="true"&gt;
        &lt;CheckBox id="checkBox"
                label="valueWrap"
                labelPlacement="left" /&gt;
    &lt;/ApplicationControlBar&gt;

    &lt;FxNumericStepper id="numericStepper"
            valueWrap="{checkBox.selected}"
            minimum="0"
            maximum="10" /&gt;

&lt;/Application&gt;
</pre>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/FxNumericStepper_valueWrap_test/bin/srcview/index.html">View source</a> is enabled in the following example.</p>
<p><iframe src="http://blog.flexexamples.com/wp-content/uploads/FxNumericStepper_valueWrap_test/bin/main_4112.html" width="100%" height="150"></iframe></p>
<p>Due to popular demand, here is the &#8220;same&#8221; example in a more ActionScript friendly format:</p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/FxNumericStepper_valueWrap_test/bin/srcview/source/main2_4112.mxml.html">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2008/11/17/wrapping-values-on-an-fxnumericstepper-control-in-flex-gumbo/ --&gt;
&lt;Application name="FxNumericStepper_valueWrap_test"
        xmlns="http://ns.adobe.com/mxml/2009"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"
        preinitialize="init();"&gt;

    &lt;Script&gt;
        &lt;![CDATA[
            import mx.containers.ApplicationControlBar;
            import mx.controls.ButtonLabelPlacement;
            import mx.controls.CheckBox;
            import mx.components.FxNumericStepper;

            private var checkBox:CheckBox;
            private var numericStepper:FxNumericStepper;

            private function init():void {
                checkBox = new CheckBox();
                checkBox.label = "valueWrap:";
                checkBox.labelPlacement = ButtonLabelPlacement.LEFT;
                checkBox.addEventListener(Event.CHANGE, checkBox_change);

                var appControlBar:ApplicationControlBar;
                appControlBar = new ApplicationControlBar();
                appControlBar.dock = true;
                appControlBar.addChild(checkBox);
                addChildAt(appControlBar, 0);

                numericStepper = new FxNumericStepper();
                numericStepper.minimum = 0;
                numericStepper.maximum = 10;
                numericStepper.valueWrap = checkBox.selected;
                addChild(numericStepper);
            }

            private function checkBox_change(evt:Event):void {
                numericStepper.valueWrap = checkBox.selected;
            }
        ]]&gt;
    &lt;/Script&gt;

&lt;/Application&gt;
</pre>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Wrapping values on an FxNumericStepper control in Flex Gumbo on FlexExamples.com',url: 'http://blog.flexexamples.com/2008/11/17/wrapping-values-on-an-fxnumericstepper-control-in-flex-gumbo/',contentID: 'post-867',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'Gumbo,valueWrap',providerName: 'FlexExamples.com',styling: 'text' });return false" class="evernoteSiteMemoryLink"><img src="http://static.evernote.com/article-clipper-remember.png" class="evernoteSiteMemoryButton" />
				</a>				<div class="evernoteSiteMemoryClear">&nbsp;</div>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.flexexamples.com/2008/11/17/wrapping-values-on-an-fxnumericstepper-control-in-flex-gumbo/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

