<?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; focusAlpha</title>
	<atom:link href="http://blog.flexexamples.com/tag/focusalpha/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>Setting the focus alpha on a Spark TextArea control in Flex 4</title>
		<link>http://blog.flexexamples.com/2009/09/08/setting-the-focus-alpha-on-a-spark-textarea-control-in-flex-4/</link>
		<comments>http://blog.flexexamples.com/2009/09/08/setting-the-focus-alpha-on-a-spark-textarea-control-in-flex-4/#comments</comments>
		<pubDate>Tue, 08 Sep 2009 13:30:19 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[beta1]]></category>
		<category><![CDATA[TextArea (Spark)]]></category>
		<category><![CDATA[focusAlpha]]></category>
		<category><![CDATA[focusColor]]></category>
		<category><![CDATA[Gumbo]]></category>
		<category><![CDATA[setFocus()]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/?p=1839</guid>
		<description><![CDATA[<p>The following example shows how you can set the focus alpha on the Spark TextArea control in Flex 4 by setting the focusAlpha style.</p> <p>Full code after the jump.</p> <p></p> &#60;?xml version=&#34;1.0&#34; encoding=&#34;utf-8&#34;?&#62; &#60;!-- http://blog.flexexamples.com/2009/09/08/setting-the-focus-alpha-on-a-spark-textarea-control-in-flex-4/ --&#62; &#60;s:Application name=&#34;Spark_TextArea_focusAlpha_test&#34; xmlns:fx=&#34;http://ns.adobe.com/mxml/2009&#34; xmlns:s=&#34;library://ns.adobe.com/flex/spark&#34; xmlns:mx=&#34;library://ns.adobe.com/flex/halo&#34;&#62; &#60;s:controlBarContent&#62; &#60;mx:Form contentBackgroundAlpha=&#34;0&#34;&#62; &#60;mx:FormItem label=&#34;focusAlpha:&#34;&#62; &#60;s:HSlider id=&#34;slider&#34; minimum=&#34;0.0&#34; maximum=&#34;1.0&#34; value=&#34;0.8&#34; snapInterval=&#34;0.1&#34; stepSize=&#34;0.1&#34; change=&#34;txtArea.setFocus();&#34; /&#62; [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can set the focus alpha on the Spark TextArea control in Flex 4 by setting the <code>focusAlpha</code> style.</p>
<p>Full code after the jump.</p>
<p><span id="more-1839"></span></p>
<p class="alert">The following example(s) require Flash Player 10 and the Adobe Flex 4 SDK. To download the Adobe Flash Builder 4 trial, see <a href="http://bit.ly/crThlI">http://www.adobe.com/products/flex/</a>. To download the latest nightly build of the Flex 4 SDK, see <a href="http://bit.ly/Flex4SDK">http://opensource.adobe.com/wiki/display/flexsdk/Download+Flex+4</a>.<br/><strong>For more information on getting started with Flex 4 and Flash Builder 4, see the official <a href="http://bit.ly/dCkecm">Adobe Flex Team blog</a>.</strong></p>

<div class="wp_syntax"><div class="code"><pre class="mxml" style="font-family:monospace;"><span style="color: #000000;">&lt;?xml version=<span style="color: #ff0000;">&quot;1.0&quot;</span> encoding=<span style="color: #ff0000;">&quot;utf-8&quot;</span>?<span style="color: #7400FF;">&gt;</span></span>
<span style="color: #000000;"><span style="color: #808080; font-style: italic;">&lt;!-- http://blog.flexexamples.com/2009/09/08/setting-the-focus-alpha-on-a-spark-textarea-control-in-flex-4/ --&gt;</span></span>
<span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Application</span> name=<span style="color: #ff0000;">&quot;Spark_TextArea_focusAlpha_test&quot;</span></span>
<span style="color: #000000;">        xmlns:fx=<span style="color: #ff0000;">&quot;http://ns.adobe.com/mxml/2009&quot;</span></span>
<span style="color: #000000;">        xmlns:s=<span style="color: #ff0000;">&quot;library://ns.adobe.com/flex/spark&quot;</span></span>
<span style="color: #000000;">        xmlns:mx=<span style="color: #ff0000;">&quot;library://ns.adobe.com/flex/halo&quot;</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:controlBarContent</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Form</span> contentBackgroundAlpha=<span style="color: #ff0000;">&quot;0&quot;</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:FormItem</span> label=<span style="color: #ff0000;">&quot;focusAlpha:&quot;</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:HSlider</span> id=<span style="color: #ff0000;">&quot;slider&quot;</span></span>
<span style="color: #000000;">                        minimum=<span style="color: #ff0000;">&quot;0.0&quot;</span></span>
<span style="color: #000000;">                        maximum=<span style="color: #ff0000;">&quot;1.0&quot;</span></span>
<span style="color: #000000;">                        value=<span style="color: #ff0000;">&quot;0.8&quot;</span></span>
<span style="color: #000000;">                        snapInterval=<span style="color: #ff0000;">&quot;0.1&quot;</span></span>
<span style="color: #000000;">                        stepSize=<span style="color: #ff0000;">&quot;0.1&quot;</span></span>
<span style="color: #000000;">                        change=<span style="color: #ff0000;">&quot;txtArea.setFocus();&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:FormItem</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:FormItem</span> label=<span style="color: #ff0000;">&quot;focusColor:&quot;</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:ColorPicker</span> id=<span style="color: #ff0000;">&quot;colorPicker&quot;</span></span>
<span style="color: #000000;">                        selectedColor=<span style="color: #ff0000;">&quot;haloBlue&quot;</span></span>
<span style="color: #000000;">                        change=<span style="color: #ff0000;">&quot;callLater(txtArea.setFocus);&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:FormItem</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:Form</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:controlBarContent</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:TextArea</span> id=<span style="color: #ff0000;">&quot;txtArea&quot;</span></span>
<span style="color: #000000;">            focusAlpha=<span style="color: #ff0000;">&quot;{slider.value}&quot;</span></span>
<span style="color: #000000;">            focusColor=<span style="color: #ff0000;">&quot;{colorPicker.selectedColor}&quot;</span></span>
<span style="color: #000000;">            horizontalCenter=<span style="color: #ff0000;">&quot;0&quot;</span> verticalCenter=<span style="color: #ff0000;">&quot;0&quot;</span></span>
<span style="color: #000000;">            creationComplete=<span style="color: #ff0000;">&quot;txtArea.setFocus();&quot;</span><span style="color: #7400FF;">/&gt;</span></span>
&nbsp;
<span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:Application</span><span style="color: #7400FF;">&gt;</span></span></pre></div></div>

<p class="alert">This entry is based on a beta version of the Flex 4 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 4 SDK.</p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Setting the focus alpha on a Spark TextArea control in Flex 4 on FlexExamples.com',url: 'http://blog.flexexamples.com/2009/09/08/setting-the-focus-alpha-on-a-spark-textarea-control-in-flex-4/',contentID: 'post-1839',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'focusAlpha,focusColor,Gumbo,setFocus()',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/2009/09/08/setting-the-focus-alpha-on-a-spark-textarea-control-in-flex-4/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Setting the focus alpha on a NumericStepper control in Flex</title>
		<link>http://blog.flexexamples.com/2008/05/23/setting-the-focus-alpha-on-a-numericstepper-control-in-flex/</link>
		<comments>http://blog.flexexamples.com/2008/05/23/setting-the-focus-alpha-on-a-numericstepper-control-in-flex/#comments</comments>
		<pubDate>Sat, 24 May 2008 06:27:53 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[FocusManager]]></category>
		<category><![CDATA[NumericStepper]]></category>
		<category><![CDATA[focusAlpha]]></category>
		<category><![CDATA[setFocus()]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2008/05/23/setting-the-focus-alpha-on-a-numericstepper-control-in-flex/</guid>
		<description><![CDATA[<p>The following example shows how you can set the focus alpha on a Flex NumericStepper control by setting the focusAlpha style.</p> <p>Full code after the jump.</p> <p></p> <p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/NumericStepper_focusAlpha_test/bin/srcview/source/main.mxml.html">View MXML</a></p> &#60;?xml version="1.0" encoding="utf-8"?&#62; &#60;!-- http://blog.flexexamples.com/2008/05/23/setting-the-focus-alpha-on-a-numericstepper-control-in-flex/ --&#62; &#60;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" verticalAlign="middle" backgroundColor="white"&#62; &#60;mx:Script&#62; &#60;![CDATA[ import mx.events.NumericStepperEvent; private function numericStepper_change(evt:NumericStepperEvent):void { // reset focus focusManager.setFocus(btn); focusManager.setFocus(numericStepper); [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can set the focus alpha on a Flex NumericStepper control by setting the <code>focusAlpha</code> style.</p>
<p>Full code after the jump.</p>
<p><span id="more-641"></span></p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/NumericStepper_focusAlpha_test/bin/srcview/source/main.mxml.html">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2008/05/23/setting-the-focus-alpha-on-a-numericstepper-control-in-flex/ --&gt;
&lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"&gt;

    &lt;mx:Script&gt;
        &lt;![CDATA[
            import mx.events.NumericStepperEvent;

            private function numericStepper_change(evt:NumericStepperEvent):void {
                // reset focus
                focusManager.setFocus(btn);
                focusManager.setFocus(numericStepper);
            }
        ]]&gt;
    &lt;/mx:Script&gt;

    &lt;mx:ApplicationControlBar dock="true"&gt;
        &lt;mx:Button id="btn" label="click here to remove focus" /&gt;
    &lt;/mx:ApplicationControlBar&gt;

    &lt;mx:NumericStepper id="numericStepper"
            minimum="0.0"
            maximum="1.0"
            value="0.5"
            stepSize="0.1"
            textAlign="center"
            focusAlpha="{numericStepper.value}"
            change="numericStepper_change(event);" /&gt;

&lt;/mx:Application&gt;
</pre>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/NumericStepper_focusAlpha_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/NumericStepper_focusAlpha_test/bin/main.html" width="100%" height="150"></iframe></p>
<p>You can also set the <code>focusAlpha</code> style in an external .CSS file or &lt;mx:Style /&gt; block, as shown in the following example:</p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/NumericStepper_focusAlpha_test/bin/srcview/source/main1.mxml.html">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2008/05/23/setting-the-focus-alpha-on-a-numericstepper-control-in-flex/ --&gt;
&lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"&gt;

    &lt;mx:Style&gt;
        NumericStepper {
            focusAlpha: 1.0;
        }
    &lt;/mx:Style&gt;

    &lt;mx:ApplicationControlBar dock="true"&gt;
        &lt;mx:Button id="btn" label="click here to remove focus" /&gt;
    &lt;/mx:ApplicationControlBar&gt;

    &lt;mx:NumericStepper id="numericStepper"
            minimum="0.0"
            maximum="1.0"
            value="1.0"
            stepSize="0.1"
            textAlign="center"/&gt;

&lt;/mx:Application&gt;
</pre>
<p>Or you can set the <code>focusAlpha</code> style using ActionScript, as seen in the following example:</p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/NumericStepper_focusAlpha_test/bin/srcview/source/main2.mxml.html">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2008/05/23/setting-the-focus-alpha-on-a-numericstepper-control-in-flex/ --&gt;
&lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"&gt;

    &lt;mx:Script&gt;
        &lt;![CDATA[
            import mx.events.NumericStepperEvent;

            private function numericStepper_change(evt:NumericStepperEvent):void {
                numericStepper.setStyle("focusAlpha", evt.value);
                // reset focus
                focusManager.setFocus(btn);
                focusManager.setFocus(numericStepper);
            }
        ]]&gt;
    &lt;/mx:Script&gt;

    &lt;mx:ApplicationControlBar dock="true"&gt;
        &lt;mx:Button id="btn" label="click here to remove focus" /&gt;
    &lt;/mx:ApplicationControlBar&gt;

    &lt;mx:NumericStepper id="numericStepper"
            minimum="0.0"
            maximum="1.0"
            value="0.5"
            stepSize="0.1"
            textAlign="center"
            change="numericStepper_change(event);" /&gt;

&lt;/mx:Application&gt;
</pre>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Setting the focus alpha on a NumericStepper control in Flex on FlexExamples.com',url: 'http://blog.flexexamples.com/2008/05/23/setting-the-focus-alpha-on-a-numericstepper-control-in-flex/',contentID: 'post-641',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'focusAlpha,setFocus()',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/05/23/setting-the-focus-alpha-on-a-numericstepper-control-in-flex/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

