<?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; backgroundAlpha</title>
	<atom:link href="http://blog.flexexamples.com/tag/backgroundalpha/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 background alpha on a Spark FormHeading control in Flex Hero</title>
		<link>http://blog.flexexamples.com/2010/09/01/setting-the-background-alpha-on-a-spark-formheading-control-in-flex-hero/</link>
		<comments>http://blog.flexexamples.com/2010/09/01/setting-the-background-alpha-on-a-spark-formheading-control-in-flex-hero/#comments</comments>
		<pubDate>Wed, 01 Sep 2010 23:27:07 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[Form (Spark)]]></category>
		<category><![CDATA[FormHeading (Spark)]]></category>
		<category><![CDATA[backgroundAlpha]]></category>
		<category><![CDATA[Hero]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/?p=3329</guid>
		<description><![CDATA[<p>The following example shows how you can set the background alpha on a Spark FormHeading control in Flex Hero by setting the backgroundAlpha style.</p> <p></p> &#60;?xml version=&#34;1.0&#34; encoding=&#34;utf-8&#34;?&#62; &#60;!-- http://blog.flexexamples.com/2010/09/01/setting-the-background-alpha-on-a-spark-formheading-control-in-flex-hero/ --&#62; &#60;s:Application name=&#34;Spark_FormHeading_backgroundAlpha_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/mx&#34;&#62; &#60;s:layout&#62; &#60;s:VerticalLayout horizontalAlign=&#34;center&#34; verticalAlign=&#34;middle&#34; /&#62; &#60;/s:layout&#62; &#60;s:controlBarContent&#62; &#60;s:Form&#62; &#60;s:FormItem label=&#34;backgroundAlpha:&#34;&#62; &#60;s:HSlider id=&#34;sl&#34; minimum=&#34;0.0&#34; maximum=&#34;1.0&#34; value=&#34;1.0&#34; snapInterval=&#34;0.1&#34; stepSize=&#34;0.1&#34; /&#62; &#60;/s:FormItem&#62; [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can set the background alpha on a Spark FormHeading control in Flex Hero by setting the <code>backgroundAlpha</code> style.</p>
<p><span id="more-3329"></span></p>
<p class="alert">The following example(s) require Flash Player 10 and the beta Adobe Flex Hero 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 Hero SDK, see <a href="http://opensource.adobe.com/wiki/display/flexsdk/Download+Flex+Hero">http://opensource.adobe.com/wiki/display/flexsdk/Download+Flex+Hero</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/2010/09/01/setting-the-background-alpha-on-a-spark-formheading-control-in-flex-hero/ --&gt;</span></span>
<span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Application</span> name=<span style="color: #ff0000;">&quot;Spark_FormHeading_backgroundAlpha_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/mx&quot;</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:layout</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:VerticalLayout</span> horizontalAlign=<span style="color: #ff0000;">&quot;center&quot;</span> verticalAlign=<span style="color: #ff0000;">&quot;middle&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:layout</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;s:Form</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:FormItem</span> label=<span style="color: #ff0000;">&quot;backgroundAlpha:&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;sl&quot;</span></span>
<span style="color: #000000;">                        minimum=<span style="color: #ff0000;">&quot;0.0&quot;</span> maximum=<span style="color: #ff0000;">&quot;1.0&quot;</span></span>
<span style="color: #000000;">                        value=<span style="color: #ff0000;">&quot;1.0&quot;</span></span>
<span style="color: #000000;">                        snapInterval=<span style="color: #ff0000;">&quot;0.1&quot;</span> stepSize=<span style="color: #ff0000;">&quot;0.1&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:FormItem</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s: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:Form</span> id=<span style="color: #ff0000;">&quot;frm&quot;</span> defaultButton=<span style="color: #ff0000;">&quot;{submitBtn}&quot;</span> backgroundColor=<span style="color: #ff0000;">&quot;#EEEEEE&quot;</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:FormHeading</span> label=<span style="color: #ff0000;">&quot;Spark Form Heading&quot;</span></span>
<span style="color: #000000;">                backgroundColor=<span style="color: #ff0000;">&quot;haloSilver&quot;</span></span>
<span style="color: #000000;">                backgroundAlpha=<span style="color: #ff0000;">&quot;{sl.value}&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:FormItem</span> sequenceLabel=<span style="color: #ff0000;">&quot;1.&quot;</span> label=<span style="color: #ff0000;">&quot;Username:&quot;</span> required=<span style="color: #ff0000;">&quot;true&quot;</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:helpContent</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Label</span> text=<span style="color: #ff0000;">&quot;user@domain.com&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:helpContent</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:TextInput</span> id=<span style="color: #ff0000;">&quot;username&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:FormItem</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:FormItem</span> sequenceLabel=<span style="color: #ff0000;">&quot;2.&quot;</span> label=<span style="color: #ff0000;">&quot;Password:&quot;</span> required=<span style="color: #ff0000;">&quot;true&quot;</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:helpContent</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Label</span> text=<span style="color: #ff0000;">&quot;weak&quot;</span> color=<span style="color: #ff0000;">&quot;red&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:helpContent</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:TextInput</span> id=<span style="color: #ff0000;">&quot;password1&quot;</span> displayAsPassword=<span style="color: #ff0000;">&quot;true&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:FormItem</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:FormItem</span> sequenceLabel=<span style="color: #ff0000;">&quot;3.&quot;</span> label=<span style="color: #ff0000;">&quot;Confirm password:&quot;</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:helpContent</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:HGroup</span><span style="color: #7400FF;">&gt;</span></span>
                    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Label</span> text=<span style="color: #ff0000;">&quot;One&quot;</span> color=<span style="color: #ff0000;">&quot;red&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Label</span> text=<span style="color: #ff0000;">&quot;Two&quot;</span> color=<span style="color: #ff0000;">&quot;blue&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:HGroup</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:helpContent</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:TextInput</span> id=<span style="color: #ff0000;">&quot;password2&quot;</span> displayAsPassword=<span style="color: #ff0000;">&quot;true&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:FormItem</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:FormItem</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:layout</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:HorizontalLayout</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:layout</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Button</span> id=<span style="color: #ff0000;">&quot;resetBtn&quot;</span> label=<span style="color: #ff0000;">&quot;Reset&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Button</span> id=<span style="color: #ff0000;">&quot;submitBtn&quot;</span> label=<span style="color: #ff0000;">&quot;Submit&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:FormItem</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:Form</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>You can also set the <code>backgroundAlpha</code> style in an external .CSS file or &lt;Style&gt; block, as seen in the following example:</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/2010/09/01/setting-the-background-alpha-on-a-spark-formheading-control-in-flex-hero/ --&gt;</span></span>
<span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Application</span> name=<span style="color: #ff0000;">&quot;Spark_FormHeading_backgroundAlpha_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/mx&quot;</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:layout</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:VerticalLayout</span> horizontalAlign=<span style="color: #ff0000;">&quot;center&quot;</span> verticalAlign=<span style="color: #ff0000;">&quot;middle&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:layout</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Style</span><span style="color: #7400FF;">&gt;</span></span>
        @namespace s &quot;library://ns.adobe.com/flex/spark&quot;;
        @namespace mx &quot;library://ns.adobe.com/flex/mx&quot;;
&nbsp;
        s|FormHeading {
            backgroundAlpha: 0.2;
            backgroundColor: haloSilver;
        }
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/fx:Style</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Form</span> id=<span style="color: #ff0000;">&quot;frm&quot;</span> defaultButton=<span style="color: #ff0000;">&quot;{submitBtn}&quot;</span> backgroundColor=<span style="color: #ff0000;">&quot;#EEEEEE&quot;</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:FormHeading</span> id=<span style="color: #ff0000;">&quot;fh1&quot;</span></span>
<span style="color: #000000;">                label=<span style="color: #ff0000;">&quot;Spark Form Heading&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:FormItem</span> sequenceLabel=<span style="color: #ff0000;">&quot;1.&quot;</span> label=<span style="color: #ff0000;">&quot;Username:&quot;</span> required=<span style="color: #ff0000;">&quot;true&quot;</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:helpContent</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Label</span> text=<span style="color: #ff0000;">&quot;user@domain.com&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:helpContent</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:TextInput</span> id=<span style="color: #ff0000;">&quot;username&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:FormItem</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:FormItem</span> sequenceLabel=<span style="color: #ff0000;">&quot;2.&quot;</span> label=<span style="color: #ff0000;">&quot;Password:&quot;</span> required=<span style="color: #ff0000;">&quot;true&quot;</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:helpContent</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Label</span> text=<span style="color: #ff0000;">&quot;weak&quot;</span> color=<span style="color: #ff0000;">&quot;red&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:helpContent</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:TextInput</span> id=<span style="color: #ff0000;">&quot;password1&quot;</span> displayAsPassword=<span style="color: #ff0000;">&quot;true&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:FormItem</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:FormItem</span> sequenceLabel=<span style="color: #ff0000;">&quot;3.&quot;</span> label=<span style="color: #ff0000;">&quot;Confirm password:&quot;</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:helpContent</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:HGroup</span><span style="color: #7400FF;">&gt;</span></span>
                    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Label</span> text=<span style="color: #ff0000;">&quot;One&quot;</span> color=<span style="color: #ff0000;">&quot;red&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Label</span> text=<span style="color: #ff0000;">&quot;Two&quot;</span> color=<span style="color: #ff0000;">&quot;blue&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:HGroup</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:helpContent</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:TextInput</span> id=<span style="color: #ff0000;">&quot;password2&quot;</span> displayAsPassword=<span style="color: #ff0000;">&quot;true&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:FormItem</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:FormItem</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:layout</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:HorizontalLayout</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:layout</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Button</span> id=<span style="color: #ff0000;">&quot;resetBtn&quot;</span> label=<span style="color: #ff0000;">&quot;Reset&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Button</span> id=<span style="color: #ff0000;">&quot;submitBtn&quot;</span> label=<span style="color: #ff0000;">&quot;Submit&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:FormItem</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:Form</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>Or you can set the <code>backgroundAlpha</code> style using ActionScript, as seen in the following example:</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/2010/09/01/setting-the-background-alpha-on-a-spark-formheading-control-in-flex-hero/ --&gt;</span></span>
<span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Application</span> name=<span style="color: #ff0000;">&quot;Spark_FormHeading_backgroundAlpha_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/mx&quot;</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:layout</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:VerticalLayout</span> horizontalAlign=<span style="color: #ff0000;">&quot;center&quot;</span> verticalAlign=<span style="color: #ff0000;">&quot;middle&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:layout</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;s:Form</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:FormItem</span> label=<span style="color: #ff0000;">&quot;backgroundAlpha:&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;sl&quot;</span></span>
<span style="color: #000000;">                        minimum=<span style="color: #ff0000;">&quot;0.0&quot;</span> maximum=<span style="color: #ff0000;">&quot;1.0&quot;</span></span>
<span style="color: #000000;">                        value=<span style="color: #ff0000;">&quot;1.0&quot;</span></span>
<span style="color: #000000;">                        snapInterval=<span style="color: #ff0000;">&quot;0.1&quot;</span> stepSize=<span style="color: #ff0000;">&quot;0.1&quot;</span></span>
<span style="color: #000000;">                        change=<span style="color: #ff0000;">&quot;sl_changeHandler(event);&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:FormItem</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s: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;fx:Script</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;">&lt;!<span style="color: #66cc66;">&#91;</span>CDATA<span style="color: #66cc66;">&#91;</span></span>
<span style="color: #000000;">            protected function sl_changeHandler<span style="color: #66cc66;">&#40;</span>evt:Event<span style="color: #66cc66;">&#41;</span>:void <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">                fh1.setStyle<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;backgroundAlpha&quot;</span>, sl.value<span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">            <span style="color: #66cc66;">&#125;</span></span>
<span style="color: #000000;">        <span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#93;</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/fx:Script</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Form</span> id=<span style="color: #ff0000;">&quot;frm&quot;</span> defaultButton=<span style="color: #ff0000;">&quot;{submitBtn}&quot;</span> backgroundColor=<span style="color: #ff0000;">&quot;#EEEEEE&quot;</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:FormHeading</span> id=<span style="color: #ff0000;">&quot;fh1&quot;</span></span>
<span style="color: #000000;">                label=<span style="color: #ff0000;">&quot;Spark Form Heading&quot;</span></span>
<span style="color: #000000;">                backgroundColor=<span style="color: #ff0000;">&quot;haloSilver&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:FormItem</span> sequenceLabel=<span style="color: #ff0000;">&quot;1.&quot;</span> label=<span style="color: #ff0000;">&quot;Username:&quot;</span> required=<span style="color: #ff0000;">&quot;true&quot;</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:helpContent</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Label</span> text=<span style="color: #ff0000;">&quot;user@domain.com&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:helpContent</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:TextInput</span> id=<span style="color: #ff0000;">&quot;username&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:FormItem</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:FormItem</span> sequenceLabel=<span style="color: #ff0000;">&quot;2.&quot;</span> label=<span style="color: #ff0000;">&quot;Password:&quot;</span> required=<span style="color: #ff0000;">&quot;true&quot;</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:helpContent</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Label</span> text=<span style="color: #ff0000;">&quot;weak&quot;</span> color=<span style="color: #ff0000;">&quot;red&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:helpContent</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:TextInput</span> id=<span style="color: #ff0000;">&quot;password1&quot;</span> displayAsPassword=<span style="color: #ff0000;">&quot;true&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:FormItem</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:FormItem</span> sequenceLabel=<span style="color: #ff0000;">&quot;3.&quot;</span> label=<span style="color: #ff0000;">&quot;Confirm password:&quot;</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:helpContent</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:HGroup</span><span style="color: #7400FF;">&gt;</span></span>
                    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Label</span> text=<span style="color: #ff0000;">&quot;One&quot;</span> color=<span style="color: #ff0000;">&quot;red&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Label</span> text=<span style="color: #ff0000;">&quot;Two&quot;</span> color=<span style="color: #ff0000;">&quot;blue&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:HGroup</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:helpContent</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:TextInput</span> id=<span style="color: #ff0000;">&quot;password2&quot;</span> displayAsPassword=<span style="color: #ff0000;">&quot;true&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:FormItem</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:FormItem</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:layout</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:HorizontalLayout</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:layout</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Button</span> id=<span style="color: #ff0000;">&quot;resetBtn&quot;</span> label=<span style="color: #ff0000;">&quot;Reset&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Button</span> id=<span style="color: #ff0000;">&quot;submitBtn&quot;</span> label=<span style="color: #ff0000;">&quot;Submit&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:FormItem</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:Form</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 Hero 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 Hero SDK.</p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Setting the background alpha on a Spark FormHeading control in Flex Hero on FlexExamples.com',url: 'http://blog.flexexamples.com/2010/09/01/setting-the-background-alpha-on-a-spark-formheading-control-in-flex-hero/',contentID: 'post-3329',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'backgroundAlpha,Hero',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/2010/09/01/setting-the-background-alpha-on-a-spark-formheading-control-in-flex-hero/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Modifying the corner white box on an MX Container when scroll bars are visible in Flex</title>
		<link>http://blog.flexexamples.com/2010/05/05/modifying-the-corner-white-box-on-an-mx-container-when-scroll-bars-are-visible-in-flex/</link>
		<comments>http://blog.flexexamples.com/2010/05/05/modifying-the-corner-white-box-on-an-mx-container-when-scroll-bars-are-visible-in-flex/#comments</comments>
		<pubDate>Wed, 05 May 2010 23:51:13 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[HBox]]></category>
		<category><![CDATA[alpha]]></category>
		<category><![CDATA[backgroundAlpha]]></category>
		<category><![CDATA[backgroundColor]]></category>
		<category><![CDATA[getChildByName()]]></category>
		<category><![CDATA[horizontalScrollPolicy]]></category>
		<category><![CDATA[rawChildren]]></category>
		<category><![CDATA[verticalScrollPolicy]]></category>
		<category><![CDATA[visible]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/?p=2938</guid>
		<description><![CDATA[<p>The following example shows how you can modify the visibility and alpha of the white box in the lower-right corner of an MX Container in Flex when both the horizontal and vertical scroll bars are visible by using the rawChildren property and getChildByName() method.</p> <p></p> &#60;?xml version=&#34;1.0&#34; encoding=&#34;utf-8&#34;?&#62; &#60;!-- http://blog.flexexamples.com/2010/05/05/modifying-the-corner-white-box-on-an-mx-container-when-scroll-bars-are-visible-in-flex/ --&#62; &#60;mx:Application name=&#34;MX_Container_whiteBox_alpha_test&#34; xmlns:mx=&#34;http://www.adobe.com/2006/mxml&#34; layout=&#34;vertical&#34; [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can modify the visibility and alpha of the white box in the lower-right corner of an MX Container in Flex when both the horizontal and vertical scroll bars are visible by using the <code>rawChildren</code> property and <code>getChildByName()</code> method.</p>
<p><span id="more-2938"></span></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/2010/05/05/modifying-the-corner-white-box-on-an-mx-container-when-scroll-bars-are-visible-in-flex/ --&gt;</span></span>
<span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Application</span> name=<span style="color: #ff0000;">&quot;MX_Container_whiteBox_alpha_test&quot;</span></span>
<span style="color: #000000;">        xmlns:mx=<span style="color: #ff0000;">&quot;http://www.adobe.com/2006/mxml&quot;</span></span>
<span style="color: #000000;">        layout=<span style="color: #ff0000;">&quot;vertical&quot;</span></span>
<span style="color: #000000;">        verticalAlign=<span style="color: #ff0000;">&quot;middle&quot;</span></span>
<span style="color: #000000;">        backgroundGradientColors=<span style="color: #ff0000;">&quot;[#FF0000,#FF00FF]&quot;</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #339933;">&lt;mx:Script&gt;</span>
<span style="color: #339933;">        &lt;![CDATA[</span>
<span style="color: #339933;">            import mx.events.FlexEvent;</span>
&nbsp;
<span style="color: #339933;">            protected var wBox:DisplayObject;</span>
&nbsp;
<span style="color: #339933;">            protected function hBox_creationCompleteHandler(evt:FlexEvent):void {</span>
<span style="color: #339933;">                wBox = hBox.rawChildren.getChildByName(&quot;whiteBox&quot;);</span>
<span style="color: #339933;">            }</span>
&nbsp;
<span style="color: #339933;">            protected function sldr1_changeHandler(evt:Event):void {</span>
<span style="color: #339933;">                wBox.alpha = sldr1.value;</span>
<span style="color: #339933;">            }</span>
&nbsp;
<span style="color: #339933;">            protected function chckBx_changeHandler(evt:Event):void {</span>
<span style="color: #339933;">                wBox.visible = chckBx.selected;</span>
<span style="color: #339933;">            }</span>
<span style="color: #339933;">        ]]&gt;</span>
<span style="color: #339933;">    &lt;/mx:Script&gt;</span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:ApplicationControlBar</span> dock=<span style="color: #ff0000;">&quot;true&quot;</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;mx:FormItem</span> label=<span style="color: #ff0000;">&quot;whiteBox alpha:&quot;</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:HSlider</span> id=<span style="color: #ff0000;">&quot;sldr1&quot;</span></span>
<span style="color: #000000;">                        minimum=<span style="color: #ff0000;">&quot;0.0&quot;</span> maximum=<span style="color: #ff0000;">&quot;1.0&quot;</span></span>
<span style="color: #000000;">                        value=<span style="color: #ff0000;">&quot;1.0&quot;</span></span>
<span style="color: #000000;">                        snapInterval=<span style="color: #ff0000;">&quot;0.1&quot;</span></span>
<span style="color: #000000;">                        tickInterval=<span style="color: #ff0000;">&quot;0.1&quot;</span></span>
<span style="color: #000000;">                        liveDragging=<span style="color: #ff0000;">&quot;true&quot;</span></span>
<span style="color: #000000;">                        change=<span style="color: #ff0000;">&quot;sldr1_changeHandler(event);&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;whiteBox visible:&quot;</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:CheckBox</span> id=<span style="color: #ff0000;">&quot;chckBx&quot;</span></span>
<span style="color: #000000;">                        selected=<span style="color: #ff0000;">&quot;true&quot;</span></span>
<span style="color: #000000;">                        change=<span style="color: #ff0000;">&quot;chckBx_changeHandler(event);&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;HBox backgroundAlpha:&quot;</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:HSlider</span> id=<span style="color: #ff0000;">&quot;sldr2&quot;</span></span>
<span style="color: #000000;">                        minimum=<span style="color: #ff0000;">&quot;0.0&quot;</span> maximum=<span style="color: #ff0000;">&quot;1.0&quot;</span></span>
<span style="color: #000000;">                        value=<span style="color: #ff0000;">&quot;1.0&quot;</span></span>
<span style="color: #000000;">                        snapInterval=<span style="color: #ff0000;">&quot;0.1&quot;</span></span>
<span style="color: #000000;">                        tickInterval=<span style="color: #ff0000;">&quot;0.1&quot;</span></span>
<span style="color: #000000;">                        liveDragging=<span style="color: #ff0000;">&quot;true&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;HBox backgroundColor:&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;clrPckr&quot;</span></span>
<span style="color: #000000;">                        selectedColor=<span style="color: #ff0000;">&quot;green&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;/mx:ApplicationControlBar</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:HBox</span> id=<span style="color: #ff0000;">&quot;hBox&quot;</span></span>
<span style="color: #000000;">            backgroundAlpha=<span style="color: #ff0000;">&quot;{sldr2.value}&quot;</span></span>
<span style="color: #000000;">            backgroundColor=<span style="color: #ff0000;">&quot;{clrPckr.selectedColor}&quot;</span></span>
<span style="color: #000000;">            horizontalScrollPolicy=<span style="color: #ff0000;">&quot;on&quot;</span> verticalScrollPolicy=<span style="color: #ff0000;">&quot;on&quot;</span></span>
<span style="color: #000000;">            width=<span style="color: #ff0000;">&quot;240&quot;</span> height=<span style="color: #ff0000;">&quot;160&quot;</span></span>
<span style="color: #000000;">            paddingLeft=<span style="color: #ff0000;">&quot;10&quot;</span> paddingRight=<span style="color: #ff0000;">&quot;10&quot;</span></span>
<span style="color: #000000;">            paddingTop=<span style="color: #ff0000;">&quot;10&quot;</span> paddingBottom=<span style="color: #ff0000;">&quot;10&quot;</span></span>
<span style="color: #000000;">            creationComplete=<span style="color: #ff0000;">&quot;hBox_creationCompleteHandler(event);&quot;</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Button</span> label=<span style="color: #ff0000;">&quot;MX Button&quot;</span> width=<span style="color: #ff0000;">&quot;300&quot;</span> height=<span style="color: #ff0000;">&quot;100%&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:HBox</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
<span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:Application</span><span style="color: #7400FF;">&gt;</span></span></pre></div></div>

<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Modifying the corner white box on an MX Container when scroll bars are visible in Flex on FlexExamples.com',url: 'http://blog.flexexamples.com/2010/05/05/modifying-the-corner-white-box-on-an-mx-container-when-scroll-bars-are-visible-in-flex/',contentID: 'post-2938',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'alpha,backgroundAlpha,backgroundColor,getChildByName(),horizontalScrollPolicy,rawChildren,verticalScrollPolicy,visible',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/2010/05/05/modifying-the-corner-white-box-on-an-mx-container-when-scroll-bars-are-visible-in-flex/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Setting the alpha on a Spark Panel container title bar in Flex 4</title>
		<link>http://blog.flexexamples.com/2010/04/03/setting-the-alpha-on-a-spark-panel-container-title-bar-in-flex-4/</link>
		<comments>http://blog.flexexamples.com/2010/04/03/setting-the-alpha-on-a-spark-panel-container-title-bar-in-flex-4/#comments</comments>
		<pubDate>Sat, 03 Apr 2010 19:32:12 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[BorderContainer (Spark)]]></category>
		<category><![CDATA[Flex4]]></category>
		<category><![CDATA[Panel (Spark)]]></category>
		<category><![CDATA[alpha]]></category>
		<category><![CDATA[backgroundAlpha]]></category>
		<category><![CDATA[backgroundColor]]></category>
		<category><![CDATA[Gumbo]]></category>
		<category><![CDATA[tbDiv]]></category>
		<category><![CDATA[tbFill]]></category>
		<category><![CDATA[tbHilite]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/?p=2676</guid>
		<description><![CDATA[<p>The following example shows how you can create a Spark Panel container with a semi-transparent title bar in Flex 4 by creating a custom Spark Panel skin and setting the alpha property on the tbFill, tbHilite, and tbDiv skin parts, and then setting the backgroundAlpha style on the Panel container.</p> <p></p> <p>The following example has [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can create a Spark Panel container with a semi-transparent title bar in Flex 4 by creating a custom Spark Panel skin and setting the <code>alpha</code> property on the <code>tbFill</code>, <code>tbHilite</code>, and <code>tbDiv</code> skin parts, and then setting the <code>backgroundAlpha</code> style on the Panel container.</p>
<p><span id="more-2676"></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>
<p>The following example has three Spark Panel containers. The first Panel uses the default skin and setting the <code>backgroundAlpha</code> style only sets the alpha on the Panel background and not the title bar. The second Panel sets the <code>skinClass</code> style to our custom Spark Panel skin, and setting the <code>backgroundAlpha</code> style sets the alpha on the Panel background AND the title bar area. The third Panel also sets the <code>skinClass</code> style to our custom Spark Panel skin but also uses a Spark BorderContainer container to override the background fill on the Panel so only the Panel title bar area changes alpha.</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/2010/04/03/setting-the-alpha-on-a-spark-panel-container-title-bar-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_Panel_skin_tbFill_alpha_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/mx&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><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;backgroundAlpha:&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;sldr&quot;</span></span>
<span style="color: #000000;">                        minimum=<span style="color: #ff0000;">&quot;0.0&quot;</span> maximum=<span style="color: #ff0000;">&quot;1.0&quot;</span></span>
<span style="color: #000000;">                        value=<span style="color: #ff0000;">&quot;1.0&quot;</span></span>
<span style="color: #000000;">                        snapInterval=<span style="color: #ff0000;">&quot;0.1&quot;</span> stepSize=<span style="color: #ff0000;">&quot;0.1&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;backgroundColor:&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;clrPckr&quot;</span></span>
<span style="color: #000000;">                        selectedColor=<span style="color: #ff0000;">&quot;white&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: #808080; font-style: italic;">&lt;!-- background fill --&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Rect</span> width=<span style="color: #ff0000;">&quot;100%&quot;</span> height=<span style="color: #ff0000;">&quot;100%&quot;</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:fill</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:BitmapFill</span> source=<span style="color: #ff0000;">&quot;@Embed('skins/pattern_149.gif')&quot;</span> fillMode=<span style="color: #ff0000;">&quot;repeat&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:fill</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:Rect</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:HGroup</span> horizontalCenter=<span style="color: #ff0000;">&quot;0&quot;</span> verticalCenter=<span style="color: #ff0000;">&quot;-0&quot;</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Panel</span> id=<span style="color: #ff0000;">&quot;pnl1&quot;</span></span>
<span style="color: #000000;">                 title=<span style="color: #ff0000;">&quot;Default Spark Panel&quot;</span></span>
<span style="color: #000000;">                 backgroundAlpha=<span style="color: #ff0000;">&quot;{sldr.value}&quot;</span></span>
<span style="color: #000000;">                 backgroundColor=<span style="color: #ff0000;">&quot;{clrPckr.selectedColor}&quot;</span></span>
<span style="color: #000000;">                 width=<span style="color: #ff0000;">&quot;200&quot;</span> height=<span style="color: #ff0000;">&quot;160&quot;</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Scroller</span> left=<span style="color: #ff0000;">&quot;0&quot;</span> right=<span style="color: #ff0000;">&quot;0&quot;</span> top=<span style="color: #ff0000;">&quot;0&quot;</span> bottom=<span style="color: #ff0000;">&quot;0&quot;</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:VGroup</span> width=<span style="color: #ff0000;">&quot;100%&quot;</span> height=<span style="color: #ff0000;">&quot;100%&quot;</span> paddingLeft=<span style="color: #ff0000;">&quot;20&quot;</span> paddingRight=<span style="color: #ff0000;">&quot;20&quot;</span> paddingTop=<span style="color: #ff0000;">&quot;20&quot;</span> paddingBottom=<span style="color: #ff0000;">&quot;20&quot;</span><span style="color: #7400FF;">&gt;</span></span>
                    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Label</span> text=<span style="color: #ff0000;">&quot;Spark Panel contents&quot;</span> width=<span style="color: #ff0000;">&quot;100%&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:VGroup</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:Scroller</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:Panel</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Panel</span> id=<span style="color: #ff0000;">&quot;pnl2&quot;</span></span>
<span style="color: #000000;">                title=<span style="color: #ff0000;">&quot;Spark Panel w/ alpha&quot;</span></span>
<span style="color: #000000;">                skinClass=<span style="color: #ff0000;">&quot;skins.CustomPanelSkin&quot;</span></span>
<span style="color: #000000;">                backgroundAlpha=<span style="color: #ff0000;">&quot;{sldr.value}&quot;</span></span>
<span style="color: #000000;">                backgroundColor=<span style="color: #ff0000;">&quot;{clrPckr.selectedColor}&quot;</span></span>
<span style="color: #000000;">                width=<span style="color: #ff0000;">&quot;200&quot;</span> height=<span style="color: #ff0000;">&quot;160&quot;</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Scroller</span> left=<span style="color: #ff0000;">&quot;0&quot;</span> right=<span style="color: #ff0000;">&quot;0&quot;</span> top=<span style="color: #ff0000;">&quot;0&quot;</span> bottom=<span style="color: #ff0000;">&quot;0&quot;</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:VGroup</span> width=<span style="color: #ff0000;">&quot;100%&quot;</span> height=<span style="color: #ff0000;">&quot;100%&quot;</span> paddingLeft=<span style="color: #ff0000;">&quot;20&quot;</span> paddingRight=<span style="color: #ff0000;">&quot;20&quot;</span> paddingTop=<span style="color: #ff0000;">&quot;20&quot;</span> paddingBottom=<span style="color: #ff0000;">&quot;20&quot;</span><span style="color: #7400FF;">&gt;</span></span>
                    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Label</span> text=<span style="color: #ff0000;">&quot;Spark Panel contents&quot;</span> width=<span style="color: #ff0000;">&quot;100%&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:VGroup</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:Scroller</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:Panel</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Panel</span> id=<span style="color: #ff0000;">&quot;pnl3&quot;</span></span>
<span style="color: #000000;">                 title=<span style="color: #ff0000;">&quot;Spark Panel w/ alpha+fill&quot;</span></span>
<span style="color: #000000;">                 skinClass=<span style="color: #ff0000;">&quot;skins.CustomPanelSkin&quot;</span></span>
<span style="color: #000000;">                 backgroundAlpha=<span style="color: #ff0000;">&quot;{sldr.value}&quot;</span></span>
<span style="color: #000000;">                 backgroundColor=<span style="color: #ff0000;">&quot;{clrPckr.selectedColor}&quot;</span></span>
<span style="color: #000000;">                 width=<span style="color: #ff0000;">&quot;200&quot;</span> height=<span style="color: #ff0000;">&quot;160&quot;</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:BorderContainer</span> backgroundColor=<span style="color: #ff0000;">&quot;white&quot;</span> borderVisible=<span style="color: #ff0000;">&quot;false&quot;</span> width=<span style="color: #ff0000;">&quot;100%&quot;</span> height=<span style="color: #ff0000;">&quot;100%&quot;</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Scroller</span> left=<span style="color: #ff0000;">&quot;0&quot;</span> right=<span style="color: #ff0000;">&quot;0&quot;</span> top=<span style="color: #ff0000;">&quot;0&quot;</span> bottom=<span style="color: #ff0000;">&quot;0&quot;</span><span style="color: #7400FF;">&gt;</span></span>
                    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:VGroup</span> width=<span style="color: #ff0000;">&quot;100%&quot;</span> height=<span style="color: #ff0000;">&quot;100%&quot;</span> paddingLeft=<span style="color: #ff0000;">&quot;20&quot;</span> paddingRight=<span style="color: #ff0000;">&quot;20&quot;</span> paddingTop=<span style="color: #ff0000;">&quot;20&quot;</span> paddingBottom=<span style="color: #ff0000;">&quot;20&quot;</span><span style="color: #7400FF;">&gt;</span></span>
                        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Label</span> text=<span style="color: #ff0000;">&quot;Spark Panel contents&quot;</span> width=<span style="color: #ff0000;">&quot;100%&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:VGroup</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:Scroller</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:BorderContainer</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:Panel</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:HGroup</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>And the custom Spark Panel skin, <em>skins/CustomPanelSkin.mxml</em>, is as follows:</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/2010/04/03/setting-the-alpha-on-a-spark-panel-container-title-bar-in-flex-4/ --&gt;</span></span>
<span style="color: #000000;"><span style="color: #7400FF;">&lt;s:SparkSkin</span> name=<span style="color: #ff0000;">&quot;CustomPanelSkin&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:fb=<span style="color: #ff0000;">&quot;http://ns.adobe.com/flashbuilder/2009&quot;</span></span>
<span style="color: #000000;">        blendMode=<span style="color: #ff0000;">&quot;normal&quot;</span></span>
<span style="color: #000000;">        mouseEnabled=<span style="color: #ff0000;">&quot;false&quot;</span></span>
<span style="color: #000000;">        minWidth=<span style="color: #ff0000;">&quot;131&quot;</span> minHeight=<span style="color: #ff0000;">&quot;127&quot;</span></span>
<span style="color: #000000;">        alpha.disabled=<span style="color: #ff0000;">&quot;0.5&quot;</span> alpha.disabledWithControlBar=<span style="color: #ff0000;">&quot;0.5&quot;</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #808080; font-style: italic;">&lt;!-- states --&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:states</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:State</span> name=<span style="color: #ff0000;">&quot;normal&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:State</span> name=<span style="color: #ff0000;">&quot;disabled&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:State</span> name=<span style="color: #ff0000;">&quot;normalWithControlBar&quot;</span> stateGroups=<span style="color: #ff0000;">&quot;withControls&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:State</span> name=<span style="color: #ff0000;">&quot;disabledWithControlBar&quot;</span> stateGroups=<span style="color: #ff0000;">&quot;withControls&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:states</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Metadata</span><span style="color: #7400FF;">&gt;</span></span>
        [HostComponent(&quot;spark.components.Panel&quot;)]
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/fx:Metadata</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Script</span> fb:purpose=<span style="color: #ff0000;">&quot;styling&quot;</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;">&lt;!<span style="color: #66cc66;">&#91;</span>CDATA<span style="color: #66cc66;">&#91;</span></span>
<span style="color: #000000;">            /* Define the skin elements that should not be colorized.</span>
<span style="color: #000000;">            For panel, border and title background are skinned, but the content area and title text are not. */</span>
<span style="color: #000000;">            static private const exclusions:Array = <span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">&quot;background&quot;</span>, <span style="color: #ff0000;">&quot;titleDisplay&quot;</span>, <span style="color: #ff0000;">&quot;contentGroup&quot;</span>, <span style="color: #ff0000;">&quot;controlBarGroup&quot;</span><span style="color: #66cc66;">&#93;</span>;</span>
&nbsp;
<span style="color: #000000;">            override public function get colorizeExclusions<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:Array <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">                return exclusions;</span>
<span style="color: #000000;">            <span style="color: #66cc66;">&#125;</span></span>
&nbsp;
<span style="color: #000000;">            override protected function initializationComplete<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:void <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">                useChromeColor = true;</span>
<span style="color: #000000;">                super.initializationComplete<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">            <span style="color: #66cc66;">&#125;</span></span>
&nbsp;
<span style="color: #000000;">            override protected function updateDisplayList<span style="color: #66cc66;">&#40;</span>unscaledWidth:Number, unscaledHeight:Number<span style="color: #66cc66;">&#41;</span>:void <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">                if <span style="color: #66cc66;">&#40;</span>getStyle<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;borderVisible&quot;</span><span style="color: #66cc66;">&#41;</span> == true<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">                    border.visible = true;</span>
<span style="color: #000000;">                    background.left = background.top = background.right = background.bottom = <span style="color: #cc66cc;">1</span>;</span>
<span style="color: #000000;">                    contents.left = contents.top = contents.right = contents.bottom = <span style="color: #cc66cc;">1</span>;</span>
<span style="color: #000000;">                <span style="color: #66cc66;">&#125;</span> else <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">                    border.visible = false;</span>
<span style="color: #000000;">                    background.left = background.top = background.right = background.bottom = <span style="color: #cc66cc;">0</span>;</span>
<span style="color: #000000;">                    contents.left = contents.top = contents.right = contents.bottom = <span style="color: #cc66cc;">0</span>;</span>
<span style="color: #000000;">                <span style="color: #66cc66;">&#125;</span></span>
&nbsp;
<span style="color: #000000;">                dropShadow.visible = getStyle<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;dropShadowVisible&quot;</span><span style="color: #66cc66;">&#41;</span>;</span>
&nbsp;
<span style="color: #000000;">                var cr:Number = getStyle<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;cornerRadius&quot;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                var withControls:Boolean = <span style="color: #66cc66;">&#40;</span>currentState == <span style="color: #ff0000;">&quot;disabledWithControlBar&quot;</span> || currentState == <span style="color: #ff0000;">&quot;normalWithControlBar&quot;</span><span style="color: #66cc66;">&#41;</span>;</span>
&nbsp;
<span style="color: #000000;">                if <span style="color: #66cc66;">&#40;</span>cornerRadius != cr<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">                    cornerRadius = cr;</span>
&nbsp;
<span style="color: #000000;">                    dropShadow.tlRadius = cornerRadius;</span>
<span style="color: #000000;">                    dropShadow.trRadius = cornerRadius;</span>
<span style="color: #000000;">                    dropShadow.blRadius = withControls ? cornerRadius : <span style="color: #cc66cc;">0</span>;</span>
<span style="color: #000000;">                    dropShadow.brRadius = withControls ? cornerRadius : <span style="color: #cc66cc;">0</span>;</span>
&nbsp;
<span style="color: #000000;">                    setPartCornerRadii<span style="color: #66cc66;">&#40;</span>topMaskRect, withControls<span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                    setPartCornerRadii<span style="color: #66cc66;">&#40;</span>border, withControls<span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                    setPartCornerRadii<span style="color: #66cc66;">&#40;</span>background, withControls<span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                <span style="color: #66cc66;">&#125;</span></span>
&nbsp;
<span style="color: #000000;">                if <span style="color: #66cc66;">&#40;</span>bottomMaskRect<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">                    setPartCornerRadii<span style="color: #66cc66;">&#40;</span>bottomMaskRect, withControls<span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                <span style="color: #66cc66;">&#125;</span></span>
&nbsp;
<span style="color: #000000;">                borderStroke.color = getStyle<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;borderColor&quot;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                borderStroke.alpha = getStyle<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;borderAlpha&quot;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                backgroundFill.color = getStyle<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;backgroundColor&quot;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                backgroundFill.alpha = getStyle<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;backgroundAlpha&quot;</span><span style="color: #66cc66;">&#41;</span>;</span>
&nbsp;
<span style="color: #000000;">                super.updateDisplayList<span style="color: #66cc66;">&#40;</span>unscaledWidth, unscaledHeight<span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">            <span style="color: #66cc66;">&#125;</span></span>
&nbsp;
<span style="color: #000000;">            private function setPartCornerRadii<span style="color: #66cc66;">&#40;</span>target:Rect, includeBottom:Boolean<span style="color: #66cc66;">&#41;</span>:void <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">                target.topLeftRadiusX = cornerRadius;</span>
<span style="color: #000000;">                target.topRightRadiusX = cornerRadius;</span>
<span style="color: #000000;">                target.bottomLeftRadiusX = includeBottom ? cornerRadius : <span style="color: #cc66cc;">0</span>;</span>
<span style="color: #000000;">                target.bottomRightRadiusX = includeBottom ? cornerRadius : <span style="color: #cc66cc;">0</span>;</span>
<span style="color: #000000;">            <span style="color: #66cc66;">&#125;</span></span>
&nbsp;
<span style="color: #000000;">            private var cornerRadius:Number;</span>
<span style="color: #000000;">        <span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#93;</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/fx:Script</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #808080; font-style: italic;">&lt;!-- drop shadow can't be hittable so it stays sibling of other graphics --&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:RectangularDropShadow</span> id=<span style="color: #ff0000;">&quot;dropShadow&quot;</span></span>
<span style="color: #000000;">            blurX=<span style="color: #ff0000;">&quot;20&quot;</span> blurY=<span style="color: #ff0000;">&quot;20&quot;</span> alpha=<span style="color: #ff0000;">&quot;0.32&quot;</span> distance=<span style="color: #ff0000;">&quot;11&quot;</span></span>
<span style="color: #000000;">            angle=<span style="color: #ff0000;">&quot;90&quot;</span> color=<span style="color: #ff0000;">&quot;#000000&quot;</span></span>
<span style="color: #000000;">            left=<span style="color: #ff0000;">&quot;0&quot;</span> top=<span style="color: #ff0000;">&quot;0&quot;</span> right=<span style="color: #ff0000;">&quot;0&quot;</span> bottom=<span style="color: #ff0000;">&quot;0&quot;</span><span style="color: #7400FF;">/&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #808080; font-style: italic;">&lt;!-- drop shadow can't be hittable so all other graphics go in this group --&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Group</span> left=<span style="color: #ff0000;">&quot;0&quot;</span> right=<span style="color: #ff0000;">&quot;0&quot;</span> top=<span style="color: #ff0000;">&quot;0&quot;</span> bottom=<span style="color: #ff0000;">&quot;0&quot;</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
        <span style="color: #000000;"><span style="color: #808080; font-style: italic;">&lt;!-- top group mask --&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Group</span> id=<span style="color: #ff0000;">&quot;topGroupMask&quot;</span></span>
<span style="color: #000000;">                 left=<span style="color: #ff0000;">&quot;1&quot;</span> top=<span style="color: #ff0000;">&quot;1&quot;</span> right=<span style="color: #ff0000;">&quot;1&quot;</span> bottom=<span style="color: #ff0000;">&quot;1&quot;</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Rect</span> id=<span style="color: #ff0000;">&quot;topMaskRect&quot;</span></span>
<span style="color: #000000;">                    left=<span style="color: #ff0000;">&quot;0&quot;</span> top=<span style="color: #ff0000;">&quot;0&quot;</span> right=<span style="color: #ff0000;">&quot;0&quot;</span> bottom=<span style="color: #ff0000;">&quot;0&quot;</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:fill</span><span style="color: #7400FF;">&gt;</span></span>
                    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:SolidColor</span> alpha=<span style="color: #ff0000;">&quot;0&quot;</span><span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:fill</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:Rect</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:Group</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
        <span style="color: #000000;"><span style="color: #808080; font-style: italic;">&lt;!-- bottom group mask --&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Group</span> id=<span style="color: #ff0000;">&quot;bottomGroupMask&quot;</span></span>
<span style="color: #000000;">                 left=<span style="color: #ff0000;">&quot;1&quot;</span> top=<span style="color: #ff0000;">&quot;1&quot;</span> right=<span style="color: #ff0000;">&quot;1&quot;</span> bottom=<span style="color: #ff0000;">&quot;1&quot;</span></span>
<span style="color: #000000;">                 includeIn=<span style="color: #ff0000;">&quot;normalWithControlBar, disabledWithControlBar&quot;</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Rect</span> id=<span style="color: #ff0000;">&quot;bottomMaskRect&quot;</span> left=<span style="color: #ff0000;">&quot;0&quot;</span> top=<span style="color: #ff0000;">&quot;0&quot;</span> right=<span style="color: #ff0000;">&quot;0&quot;</span> bottom=<span style="color: #ff0000;">&quot;0&quot;</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:fill</span><span style="color: #7400FF;">&gt;</span></span>
                    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:SolidColor</span> alpha=<span style="color: #ff0000;">&quot;0&quot;</span><span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:fill</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:Rect</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:Group</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
        <span style="color: #000000;"><span style="color: #808080; font-style: italic;">&lt;!-- layer 1: border --&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Rect</span> id=<span style="color: #ff0000;">&quot;border&quot;</span></span>
<span style="color: #000000;">                left=<span style="color: #ff0000;">&quot;0&quot;</span> right=<span style="color: #ff0000;">&quot;0&quot;</span> top=<span style="color: #ff0000;">&quot;0&quot;</span> bottom=<span style="color: #ff0000;">&quot;0&quot;</span> <span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:stroke</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:SolidColorStroke</span> id=<span style="color: #ff0000;">&quot;borderStroke&quot;</span> weight=<span style="color: #ff0000;">&quot;1&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:stroke</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:Rect</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
        <span style="color: #000000;"><span style="color: #808080; font-style: italic;">&lt;!-- layer 2: background fill --&gt;</span></span>
        <span style="color: #000000;"><span style="color: #808080; font-style: italic;">&lt;!--- Defines the appearance of the PanelSkin class's background. --&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Rect</span> id=<span style="color: #ff0000;">&quot;background&quot;</span></span>
<span style="color: #000000;">                left=<span style="color: #ff0000;">&quot;1&quot;</span> top=<span style="color: #ff0000;">&quot;1&quot;</span> right=<span style="color: #ff0000;">&quot;1&quot;</span> bottom=<span style="color: #ff0000;">&quot;1&quot;</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:fill</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:SolidColor</span> id=<span style="color: #ff0000;">&quot;backgroundFill&quot;</span> color=<span style="color: #ff0000;">&quot;#FFFFFF&quot;</span><span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:fill</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:Rect</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
        <span style="color: #000000;"><span style="color: #808080; font-style: italic;">&lt;!-- layer 3: contents --&gt;</span></span>
        <span style="color: #000000;"><span style="color: #808080; font-style: italic;">&lt;!--- Contains the vertical stack of titlebar content and controlbar. --&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Group</span> id=<span style="color: #ff0000;">&quot;contents&quot;</span></span>
<span style="color: #000000;">                 left=<span style="color: #ff0000;">&quot;1&quot;</span> right=<span style="color: #ff0000;">&quot;1&quot;</span> top=<span style="color: #ff0000;">&quot;1&quot;</span> bottom=<span style="color: #ff0000;">&quot;1&quot;</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:layout</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:VerticalLayout</span> gap=<span style="color: #ff0000;">&quot;0&quot;</span> horizontalAlign=<span style="color: #ff0000;">&quot;justify&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:layout</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Group</span> id=<span style="color: #ff0000;">&quot;topGroup&quot;</span> mask=<span style="color: #ff0000;">&quot;{topGroupMask}&quot;</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
                <span style="color: #000000;"><span style="color: #808080; font-style: italic;">&lt;!-- layer 0: title bar fill --&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Rect</span> id=<span style="color: #ff0000;">&quot;tbFill&quot;</span></span>
<span style="color: #000000;">                        left=<span style="color: #ff0000;">&quot;0&quot;</span> right=<span style="color: #ff0000;">&quot;0&quot;</span> top=<span style="color: #ff0000;">&quot;0&quot;</span> bottom=<span style="color: #ff0000;">&quot;1&quot;</span></span>
<span style="color: #000000;">                        alpha=<span style="color: #ff0000;">&quot;0.2&quot;</span><span style="color: #7400FF;">&gt;</span></span>
                    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:fill</span><span style="color: #7400FF;">&gt;</span></span>
                        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:LinearGradient</span> rotation=<span style="color: #ff0000;">&quot;90&quot;</span><span style="color: #7400FF;">&gt;</span></span>
                            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:GradientEntry</span> color=<span style="color: #ff0000;">&quot;0xE2E2E2&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:GradientEntry</span> color=<span style="color: #ff0000;">&quot;0xD9D9D9&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:LinearGradient</span><span style="color: #7400FF;">&gt;</span></span>
                    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:fill</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:Rect</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
                <span style="color: #000000;"><span style="color: #808080; font-style: italic;">&lt;!-- layer 1: title bar highlight --&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Rect</span> id=<span style="color: #ff0000;">&quot;tbHilite&quot;</span></span>
<span style="color: #000000;">                        left=<span style="color: #ff0000;">&quot;0&quot;</span> right=<span style="color: #ff0000;">&quot;0&quot;</span> top=<span style="color: #ff0000;">&quot;0&quot;</span> bottom=<span style="color: #ff0000;">&quot;0&quot;</span></span>
<span style="color: #000000;">                        alpha=<span style="color: #ff0000;">&quot;0.2&quot;</span><span style="color: #7400FF;">&gt;</span></span>
                    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:stroke</span><span style="color: #7400FF;">&gt;</span></span>
                        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:LinearGradientStroke</span> rotation=<span style="color: #ff0000;">&quot;90&quot;</span> weight=<span style="color: #ff0000;">&quot;1&quot;</span><span style="color: #7400FF;">&gt;</span></span>
                            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:GradientEntry</span> color=<span style="color: #ff0000;">&quot;0xEAEAEA&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:GradientEntry</span> color=<span style="color: #ff0000;">&quot;0xD9D9D9&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:LinearGradientStroke</span><span style="color: #7400FF;">&gt;</span></span>
                    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:stroke</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:Rect</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
                <span style="color: #000000;"><span style="color: #808080; font-style: italic;">&lt;!-- layer 2: title bar divider --&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Rect</span> id=<span style="color: #ff0000;">&quot;tbDiv&quot;</span></span>
<span style="color: #000000;">                        left=<span style="color: #ff0000;">&quot;0&quot;</span> right=<span style="color: #ff0000;">&quot;0&quot;</span> height=<span style="color: #ff0000;">&quot;1&quot;</span> bottom=<span style="color: #ff0000;">&quot;0&quot;</span></span>
<span style="color: #000000;">                        alpha=<span style="color: #ff0000;">&quot;0.2&quot;</span><span style="color: #7400FF;">&gt;</span></span>
                    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:fill</span><span style="color: #7400FF;">&gt;</span></span>
                        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:SolidColor</span> color=<span style="color: #ff0000;">&quot;0xC0C0C0&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:fill</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:Rect</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
                <span style="color: #000000;"><span style="color: #808080; font-style: italic;">&lt;!-- layer 3: text --&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Label</span> id=<span style="color: #ff0000;">&quot;titleDisplay&quot;</span></span>
<span style="color: #000000;">                         maxDisplayedLines=<span style="color: #ff0000;">&quot;1&quot;</span></span>
<span style="color: #000000;">                         left=<span style="color: #ff0000;">&quot;9&quot;</span> right=<span style="color: #ff0000;">&quot;3&quot;</span> top=<span style="color: #ff0000;">&quot;1&quot;</span> bottom=<span style="color: #ff0000;">&quot;0&quot;</span></span>
<span style="color: #000000;">                         minHeight=<span style="color: #ff0000;">&quot;30&quot;</span></span>
<span style="color: #000000;">                         verticalAlign=<span style="color: #ff0000;">&quot;middle&quot;</span> fontWeight=<span style="color: #ff0000;">&quot;bold&quot;</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:Label</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:Group</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
            <span style="color: #000000;"><span style="color: #808080; font-style: italic;">&lt;!--</span>
<span style="color: #000000;">            Note: setting the minimum size to 0 here so that changes to the host component's</span>
<span style="color: #000000;">            size will not be thwarted by this skin part's minimum size.   This is a compromise,</span>
<span style="color: #000000;">            more about it here: http://bugs.adobe.com/jira/browse/SDK-21143</span>
<span style="color: #000000;">            --&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Group</span> id=<span style="color: #ff0000;">&quot;contentGroup&quot;</span></span>
<span style="color: #000000;">                     width=<span style="color: #ff0000;">&quot;100%&quot;</span> height=<span style="color: #ff0000;">&quot;100%&quot;</span></span>
<span style="color: #000000;">                     minWidth=<span style="color: #ff0000;">&quot;0&quot;</span> minHeight=<span style="color: #ff0000;">&quot;0&quot;</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:Group</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Group</span> id=<span style="color: #ff0000;">&quot;bottomGroup&quot;</span></span>
<span style="color: #000000;">                     minWidth=<span style="color: #ff0000;">&quot;0&quot;</span> minHeight=<span style="color: #ff0000;">&quot;0&quot;</span></span>
<span style="color: #000000;">                     includeIn=<span style="color: #ff0000;">&quot;normalWithControlBar, disabledWithControlBar&quot;</span> <span style="color: #7400FF;">&gt;</span></span>
&nbsp;
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Group</span> left=<span style="color: #ff0000;">&quot;0&quot;</span> right=<span style="color: #ff0000;">&quot;0&quot;</span> top=<span style="color: #ff0000;">&quot;0&quot;</span> bottom=<span style="color: #ff0000;">&quot;0&quot;</span> mask=<span style="color: #ff0000;">&quot;{bottomGroupMask}&quot;</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
                    <span style="color: #000000;"><span style="color: #808080; font-style: italic;">&lt;!-- layer 0: control bar divider line --&gt;</span></span>
                    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Rect</span> left=<span style="color: #ff0000;">&quot;0&quot;</span> right=<span style="color: #ff0000;">&quot;0&quot;</span> top=<span style="color: #ff0000;">&quot;0&quot;</span> height=<span style="color: #ff0000;">&quot;1&quot;</span> alpha=<span style="color: #ff0000;">&quot;0.22&quot;</span><span style="color: #7400FF;">&gt;</span></span>
                        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:fill</span><span style="color: #7400FF;">&gt;</span></span>
                            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:SolidColor</span> color=<span style="color: #ff0000;">&quot;0x000000&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:fill</span><span style="color: #7400FF;">&gt;</span></span>
                    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:Rect</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
                    <span style="color: #000000;"><span style="color: #808080; font-style: italic;">&lt;!-- layer 1: control bar highlight --&gt;</span></span>
                    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Rect</span> left=<span style="color: #ff0000;">&quot;0&quot;</span> right=<span style="color: #ff0000;">&quot;0&quot;</span> top=<span style="color: #ff0000;">&quot;1&quot;</span> bottom=<span style="color: #ff0000;">&quot;0&quot;</span><span style="color: #7400FF;">&gt;</span></span>
                        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:stroke</span><span style="color: #7400FF;">&gt;</span></span>
                            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:LinearGradientStroke</span> rotation=<span style="color: #ff0000;">&quot;90&quot;</span> weight=<span style="color: #ff0000;">&quot;1&quot;</span><span style="color: #7400FF;">&gt;</span></span>
                                <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:GradientEntry</span> color=<span style="color: #ff0000;">&quot;0xE5E5E5&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                                <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:GradientEntry</span> color=<span style="color: #ff0000;">&quot;0xD8D8D8&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                            <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:LinearGradientStroke</span><span style="color: #7400FF;">&gt;</span></span>
                        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:stroke</span><span style="color: #7400FF;">&gt;</span></span>
                    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:Rect</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
                    <span style="color: #000000;"><span style="color: #808080; font-style: italic;">&lt;!-- layer 2: control bar fill --&gt;</span></span>
                    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Rect</span> left=<span style="color: #ff0000;">&quot;1&quot;</span> right=<span style="color: #ff0000;">&quot;1&quot;</span> top=<span style="color: #ff0000;">&quot;2&quot;</span> bottom=<span style="color: #ff0000;">&quot;1&quot;</span><span style="color: #7400FF;">&gt;</span></span>
                        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:fill</span><span style="color: #7400FF;">&gt;</span></span>
                            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:LinearGradient</span> rotation=<span style="color: #ff0000;">&quot;90&quot;</span><span style="color: #7400FF;">&gt;</span></span>
                                <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:GradientEntry</span> color=<span style="color: #ff0000;">&quot;0xDADADA&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                                <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:GradientEntry</span> color=<span style="color: #ff0000;">&quot;0xC5C5C5&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                            <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:LinearGradient</span><span style="color: #7400FF;">&gt;</span></span>
                        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:fill</span><span style="color: #7400FF;">&gt;</span></span>
                    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:Rect</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:Group</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #808080; font-style: italic;">&lt;!-- layer 3: control bar --&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Group</span> id=<span style="color: #ff0000;">&quot;controlBarGroup&quot;</span></span>
<span style="color: #000000;">                         left=<span style="color: #ff0000;">&quot;0&quot;</span> right=<span style="color: #ff0000;">&quot;0&quot;</span> top=<span style="color: #ff0000;">&quot;1&quot;</span> bottom=<span style="color: #ff0000;">&quot;1&quot;</span> minWidth=<span style="color: #ff0000;">&quot;0&quot;</span> minHeight=<span style="color: #ff0000;">&quot;0&quot;</span><span style="color: #7400FF;">&gt;</span></span>
                    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:layout</span><span style="color: #7400FF;">&gt;</span></span>
                        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:HorizontalLayout</span> paddingLeft=<span style="color: #ff0000;">&quot;10&quot;</span> paddingRight=<span style="color: #ff0000;">&quot;10&quot;</span> paddingTop=<span style="color: #ff0000;">&quot;7&quot;</span> paddingBottom=<span style="color: #ff0000;">&quot;7&quot;</span> gap=<span style="color: #ff0000;">&quot;10&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:layout</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:Group</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:Group</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:Group</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:Group</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
<span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:SparkSkin</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 alpha on a Spark Panel container title bar in Flex 4 on FlexExamples.com',url: 'http://blog.flexexamples.com/2010/04/03/setting-the-alpha-on-a-spark-panel-container-title-bar-in-flex-4/',contentID: 'post-2676',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'alpha,backgroundAlpha,backgroundColor,Gumbo,tbDiv,tbFill,tbHilite',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/2010/04/03/setting-the-alpha-on-a-spark-panel-container-title-bar-in-flex-4/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Displaying a semi-transparent FLV file in an MX VideoDisplay control in Flex</title>
		<link>http://blog.flexexamples.com/2010/01/21/displaying-a-semi-transparent-flv-file-in-an-mx-videodisplay-control-in-flex/</link>
		<comments>http://blog.flexexamples.com/2010/01/21/displaying-a-semi-transparent-flv-file-in-an-mx-videodisplay-control-in-flex/#comments</comments>
		<pubDate>Fri, 22 Jan 2010 01:24:33 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[VideoDisplay]]></category>
		<category><![CDATA[backgroundAlpha]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/?p=2323</guid>
		<description><![CDATA[<p>The following example shows how you can display an FLV file with alpha channel transparency in an MX VideoDisplay control in Flex 3 by setting the backgroundAlpha style to 0.</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/2010/01/21/displaying-a-semi-transparent-flv-file-in-an-mx-videodisplay-control-in-flex/ --&#62; &#60;mx:Application name=&#34;VideoDisplay_backgroundAlpha_test&#34; xmlns:mx=&#34;http://www.adobe.com/2006/mxml&#34; layout=&#34;absolute&#34; backgroundGradientColors=&#34;[#FF0000,#0000FF]&#34;&#62; &#160; &#60;mx:VideoDisplay id=&#34;vidDisp&#34; source=&#34;walking.flv&#34; backgroundAlpha=&#34;0.0&#34; width=&#34;80%&#34; height=&#34;80%&#34; horizontalCenter=&#34;0&#34; [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can display an FLV file with alpha channel transparency in an MX VideoDisplay control in Flex 3 by setting the <code>backgroundAlpha</code> style to 0.</p>
<p>Full code after the jump.</p>
<p><span id="more-2323"></span></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/2010/01/21/displaying-a-semi-transparent-flv-file-in-an-mx-videodisplay-control-in-flex/ --&gt;</span></span>
<span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Application</span> name=<span style="color: #ff0000;">&quot;VideoDisplay_backgroundAlpha_test&quot;</span></span>
<span style="color: #000000;">        xmlns:mx=<span style="color: #ff0000;">&quot;http://www.adobe.com/2006/mxml&quot;</span></span>
<span style="color: #000000;">        layout=<span style="color: #ff0000;">&quot;absolute&quot;</span></span>
<span style="color: #000000;">        backgroundGradientColors=<span style="color: #ff0000;">&quot;[#FF0000,#0000FF]&quot;</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:VideoDisplay</span> id=<span style="color: #ff0000;">&quot;vidDisp&quot;</span></span>
<span style="color: #000000;">            source=<span style="color: #ff0000;">&quot;walking.flv&quot;</span></span>
<span style="color: #000000;">            backgroundAlpha=<span style="color: #ff0000;">&quot;0.0&quot;</span></span>
<span style="color: #000000;">            width=<span style="color: #ff0000;">&quot;80%&quot;</span> height=<span style="color: #ff0000;">&quot;80%&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;">            complete=<span style="color: #ff0000;">&quot;event.currentTarget.play();&quot;</span><span style="color: #7400FF;">/&gt;</span></span>
&nbsp;
<span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:Application</span><span style="color: #7400FF;">&gt;</span></span></pre></div></div>

<p class="note">The walking.flv can be found at the <a href="http://www.adobe.com/devnet/flash/articles/alpha_video.html">&#8220;Introducing True Alpha Video in Flash 8&#8243;</a> article in the <a href="http://www.adobe.com/devnet/flash/">Adobe Flash Developer Center</a>.</p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Displaying a semi-transparent FLV file in an MX VideoDisplay control in Flex on FlexExamples.com',url: 'http://blog.flexexamples.com/2010/01/21/displaying-a-semi-transparent-flv-file-in-an-mx-videodisplay-control-in-flex/',contentID: 'post-2323',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'backgroundAlpha',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/2010/01/21/displaying-a-semi-transparent-flv-file-in-an-mx-videodisplay-control-in-flex/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Setting the background alpha on a Spark SimpleText control in Flex 4</title>
		<link>http://blog.flexexamples.com/2009/07/15/setting-the-background-alpha-on-a-spark-simpletext-control-in-flex-4/</link>
		<comments>http://blog.flexexamples.com/2009/07/15/setting-the-background-alpha-on-a-spark-simpletext-control-in-flex-4/#comments</comments>
		<pubDate>Thu, 16 Jul 2009 03:22:23 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[beta1]]></category>
		<category><![CDATA[SimpleText (Spark)]]></category>
		<category><![CDATA[backgroundAlpha]]></category>
		<category><![CDATA[backgroundColor]]></category>
		<category><![CDATA[Gumbo]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/?p=1202</guid>
		<description><![CDATA[<p>The following example shows how you can set the background alpha and background color on a Spark SimpleText control in Flex 4 by setting the backgroundAlpha and backgroundColor styles.</p> <p>Full code after the jump.</p> <p></p> <p class="download"><a href="">View MXML</a></p> &#60;?xml version=&#34;1.0&#34; encoding=&#34;utf-8&#34;?&#62; &#60;!-- http://blog.flexexamples.com/2009/07/15/setting-the-background-alpha-on-a-spark-simpletext-control-in-flex-4/ --&#62; &#60;s:Application name=&#34;Spark_SimpleText_backgroundAlpha_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; &#160; &#60;mx:ApplicationControlBar width=&#34;100%&#34; cornerRadius=&#34;0&#34;&#62; &#60;mx:Form [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can set the background alpha and background color on a Spark SimpleText control in Flex 4 by setting the <code>backgroundAlpha</code> and <code>backgroundColor</code> styles.</p>
<p>Full code after the jump.</p>
<p><span id="more-1202"></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>
<p class="download"><a href="">View MXML</a></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/07/15/setting-the-background-alpha-on-a-spark-simpletext-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_SimpleText_backgroundAlpha_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>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:ApplicationControlBar</span> width=<span style="color: #ff0000;">&quot;100%&quot;</span> cornerRadius=<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:Form</span> styleName=<span style="color: #ff0000;">&quot;plain&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;backgroundColor:&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;white&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;backgroundAlpha:&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;1.0&quot;</span> </span>
<span style="color: #000000;">                        stepSize=<span style="color: #ff0000;">&quot;0.1&quot;</span> </span>
<span style="color: #000000;">                        snapInterval=<span style="color: #ff0000;">&quot;0.1&quot;</span> </span>
<span style="color: #000000;">                        liveDragging=<span style="color: #ff0000;">&quot;true&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;/mx:ApplicationControlBar</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:SimpleText</span> id=<span style="color: #ff0000;">&quot;smplTxt&quot;</span></span>
<span style="color: #000000;">            backgroundAlpha=<span style="color: #ff0000;">&quot;{slider.value}&quot;</span></span>
<span style="color: #000000;">            backgroundColor=<span style="color: #ff0000;">&quot;{colorPicker.selectedColor}&quot;</span></span>
<span style="color: #000000;">            maxWidth=<span style="color: #ff0000;">&quot;500&quot;</span></span>
<span style="color: #000000;">            horizontalCenter=<span style="color: #ff0000;">&quot;0&quot;</span></span>
<span style="color: #000000;">            verticalCenter=<span style="color: #ff0000;">&quot;0&quot;</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:String</span> source=<span style="color: #ff0000;">&quot;lorem.txt&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:SimpleText</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>You can also set the <code>backgroundAlpha</code> and <code>backgroundColor</code> styles in an external .CSS file or &lt;Style /&gt; block, as seen in the following example:</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/07/15/setting-the-background-alpha-on-a-spark-simpletext-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_SimpleText_backgroundAlpha_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>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Style</span><span style="color: #7400FF;">&gt;</span></span>
        @namespace mx &quot;library://ns.adobe.com/flex/halo&quot;;
        @namespace s &quot;library://ns.adobe.com/flex/spark&quot;;
&nbsp;
        s|SimpleText {
            backgroundAlpha: 0.2;
            backgroundColor: red;
        }
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/fx:Style</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:SimpleText</span> id=<span style="color: #ff0000;">&quot;smplTxt&quot;</span></span>
<span style="color: #000000;">            maxWidth=<span style="color: #ff0000;">&quot;500&quot;</span></span>
<span style="color: #000000;">            horizontalCenter=<span style="color: #ff0000;">&quot;0&quot;</span></span>
<span style="color: #000000;">            verticalCenter=<span style="color: #ff0000;">&quot;0&quot;</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:String</span> source=<span style="color: #ff0000;">&quot;lorem.txt&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:SimpleText</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>Or, you can set the <code>backgroundAlpha</code> and <code>backgroundColor</code> styles using ActionScript, as seen in the following example:</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/07/15/setting-the-background-alpha-on-a-spark-simpletext-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_SimpleText_backgroundAlpha_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>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Script</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;">&lt;!<span style="color: #66cc66;">&#91;</span>CDATA<span style="color: #66cc66;">&#91;</span></span>
<span style="color: #000000;">            import mx.events.ColorPickerEvent;</span>
&nbsp;
<span style="color: #000000;">            protected function colorPicker_change<span style="color: #66cc66;">&#40;</span>evt:ColorPickerEvent<span style="color: #66cc66;">&#41;</span>:void <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">                smplTxt.setStyle<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;backgroundColor&quot;</span>, evt.color<span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">            <span style="color: #66cc66;">&#125;</span></span>
&nbsp;
<span style="color: #000000;">            protected function slider_change<span style="color: #66cc66;">&#40;</span>event:Event<span style="color: #66cc66;">&#41;</span>:void <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">                smplTxt.setStyle<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;backgroundAlpha&quot;</span>, slider.value<span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">            <span style="color: #66cc66;">&#125;</span></span>
<span style="color: #000000;">        <span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#93;</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/fx:Script</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:ApplicationControlBar</span> width=<span style="color: #ff0000;">&quot;100%&quot;</span> cornerRadius=<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:Form</span> styleName=<span style="color: #ff0000;">&quot;plain&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;backgroundColor:&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;white&quot;</span></span>
<span style="color: #000000;">                        change=<span style="color: #ff0000;">&quot;colorPicker_change(event);&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;backgroundAlpha:&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;1.0&quot;</span> </span>
<span style="color: #000000;">                        stepSize=<span style="color: #ff0000;">&quot;0.1&quot;</span> </span>
<span style="color: #000000;">                        snapInterval=<span style="color: #ff0000;">&quot;0.1&quot;</span> </span>
<span style="color: #000000;">                        liveDragging=<span style="color: #ff0000;">&quot;true&quot;</span></span>
<span style="color: #000000;">                        change=<span style="color: #ff0000;">&quot;slider_change(event);&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;/mx:ApplicationControlBar</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:SimpleText</span> id=<span style="color: #ff0000;">&quot;smplTxt&quot;</span></span>
<span style="color: #000000;">            maxWidth=<span style="color: #ff0000;">&quot;500&quot;</span></span>
<span style="color: #000000;">            horizontalCenter=<span style="color: #ff0000;">&quot;0&quot;</span></span>
<span style="color: #000000;">            verticalCenter=<span style="color: #ff0000;">&quot;0&quot;</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:String</span> source=<span style="color: #ff0000;">&quot;lorem.txt&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:SimpleText</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 background alpha on a Spark SimpleText control in Flex 4 on FlexExamples.com',url: 'http://blog.flexexamples.com/2009/07/15/setting-the-background-alpha-on-a-spark-simpletext-control-in-flex-4/',contentID: 'post-1202',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'backgroundAlpha,backgroundColor,Gumbo',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/07/15/setting-the-background-alpha-on-a-spark-simpletext-control-in-flex-4/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Changing the background alpha on the Halo TextArea control in Flex 4</title>
		<link>http://blog.flexexamples.com/2009/06/09/changing-the-background-alpha-on-the-halo-textarea-control-in-flex-4/</link>
		<comments>http://blog.flexexamples.com/2009/06/09/changing-the-background-alpha-on-the-halo-textarea-control-in-flex-4/#comments</comments>
		<pubDate>Wed, 10 Jun 2009 06:59:12 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[beta1]]></category>
		<category><![CDATA[TextArea]]></category>
		<category><![CDATA[backgroundAlpha]]></category>
		<category><![CDATA[borderSkin]]></category>
		<category><![CDATA[Gumbo]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2009/06/09/changing-the-background-alpha-on-the-halo-textarea-control-in-flex-4/</guid>
		<description><![CDATA[<p>The following example shows how you can set the background alpha on the Halo TextArea control&#8217;s Spark skin in Flex 4 by setting the borderSkin style. As you may have noticed, the Halo components have new &#8220;Spark&#8221; themed skins in Flex 4 (basically so you can use Halo+Spark components in the same Flex project and [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can set the background alpha on the Halo TextArea control&#8217;s Spark skin in Flex 4 by setting the <code>borderSkin</code> style. As you may have noticed, the Halo components have new &#8220;Spark&#8221; themed skins in Flex 4 (basically so you can use Halo+Spark components in the same Flex project and have a consistent look-and-feel). You may also have noticed that several styles on the Halo controls don&#8217;t appear to work any more when using the Spark skins. For example, if you want to change the background fill alpha on the Halo TextArea control in Flex 4, you can no longer set the <code>backgroundAlpha</code> style, you&#8217;ll now need to create a custom skin and set the <code>borderSkin</code> style.</p>
<p>The various Halo component&#8217;s new Spark skins can be found in your Flex 4 SDK installation in the following location: &lt;Flex SDK&gt;\frameworks\projects\sparkskins\src\mx\skins\spark\&#8230;</p>
<p class="note">If you want to set the border skin on the Halo TextArea control, you&#8217;ll need to copy the TextInputBorderSkin.mxml file.</p>
<p>Full code after the jump.</p>
<p><span id="more-1105"></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>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/spark/TextArea_SparkSkin_backgroundAlpha_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/2009/06/09/changing-the-background-alpha-on-the-halo-textarea-control-in-flex-4/ --&gt;
&lt;s:Application name="TextArea_SparkSkin_backgroundAlpha_test"
        xmlns:fx="http://ns.adobe.com/mxml/2009"
        xmlns:s="library://ns.adobe.com/flex/spark"
        xmlns:mx="library://ns.adobe.com/flex/halo"
        backgroundColor="red"&gt;

    &lt;mx:TextArea id="textArea"
            borderSkin="skins.CustomHaloTextAreaBorderSkin"
            left="50" right="50"
            top="50" bottom="50"&gt;
        &lt;mx:htmlText&gt;&lt;fx:String source="lorem.html" /&gt;&lt;/mx:htmlText&gt;
    &lt;/mx:TextArea&gt;

&lt;/s:Application&gt;
</pre>
<p>And the custom skin class, CustomHaloTextAreaBorderSkin.mxml, is as follows:</p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/spark/TextArea_SparkSkin_backgroundAlpha_test/bin/srcview/source/skins/CustomHaloTextAreaBorderSkin.mxml.html">View skins/CustomHaloTextAreaBorderSkin.mxml</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2009/06/09/changing-the-background-alpha-on-the-halo-textarea-control-in-flex-4/ --&gt;
&lt;local:SparkSkinForHalo name="CustomHaloTextAreaBorderSkin"
        xmlns:fx="http://ns.adobe.com/mxml/2009"
        xmlns:s="library://ns.adobe.com/flex/spark"
        xmlns:local="mx.skins.spark.*"
        implements="mx.core.IBorder"&gt;

    &lt;fx:Script&gt;
        &lt;![CDATA[
            import mx.core.EdgeMetrics;
            import mx.core.IUIComponent;

            /* Define the skin elements that should not be colorized. */
            static private const exclusions:Array = ["background"];
            override public function get colorizeExclusions():Array {return exclusions;}

            /* Define the content fill items that should be colored by the "contentBackgroundColor" style. */
            static private const contentFill:Array = ["bgFill"];
            override public function get contentItems():Array {return contentFill};

            /* Define the border items.*/
            static private const borderItem:Array = ["borderEntry1", "borderEntry2"];
            override protected function get borderItems():Array {return borderItem;}

            static private const metrics:EdgeMetrics = new EdgeMetrics(2, 2, 2, 2);

            public function get borderMetrics():EdgeMetrics {
                return metrics;
            }

            override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void {
                super.updateDisplayList(unscaledWidth, unscaledHeight);

                if (parent &#038;&#038; (parent is IUIComponent) &#038;&#038; !IUIComponent(parent).enabled) {
                    alpha = 0.5;
                } else {
                    alpha = 1;
                }
            }
        ]]&gt;
    &lt;/fx:Script&gt;

    &lt;!-- border --&gt;
    &lt;s:Rect left="0" right="0" top="0" bottom="0"&gt;
        &lt;s:stroke&gt;
            &lt;s:LinearGradientStroke rotation="90" weight="1"&gt;
                &lt;s:GradientEntry id="borderEntry1" alpha="0.5525" /&gt;
                &lt;s:GradientEntry id="borderEntry2" alpha="0.6375" /&gt;
            &lt;/s:LinearGradientStroke&gt;
        &lt;/s:stroke&gt;
    &lt;/s:Rect&gt;

    &lt;!-- fill --&gt;
    &lt;s:Rect id="background" left="1" right="1" top="1" bottom="1"&gt;
        &lt;s:fill&gt;
            &lt;s:SolidColor id="bgFill" color="0xFFFFFF" alpha="0.4" /&gt;
        &lt;/s:fill&gt;
    &lt;/s:Rect&gt;

    &lt;!-- shadow --&gt;
    &lt;s:Rect left="1" top="1" right="1" height="1"&gt;
        &lt;s:fill&gt;
            &lt;s:SolidColor color="0x000000" alpha="0.12" /&gt;
        &lt;/s:fill&gt;
    &lt;/s:Rect&gt;

&lt;/local:SparkSkinForHalo&gt;
</pre>
<p class="alert">The default Spark skins for the MX/Halo controls/containers can be found in the Flex SDK at:<br/>
<em>%Flex SDK%</em>\frameworks\projects\sparkskins\src\mx\skins\spark\*.</p>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/spark/TextArea_SparkSkin_backgroundAlpha_test/bin/srcview/">View source</a> is enabled in the following example.</p>
<p><iframe src="http://blog.flexexamples.com/wp-content/uploads/spark/TextArea_SparkSkin_backgroundAlpha_test/bin/main.html" width="100%" height="400"></iframe></p>
<p>You can also set the <code>borderSkin</code> style in an external .CSS file or &lt;Style/&gt; block, as seen in the following example:</p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/spark/TextArea_SparkSkin_backgroundAlpha_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/2009/06/09/changing-the-background-alpha-on-the-halo-textarea-control-in-flex-4/ --&gt;
&lt;s:Application name="TextArea_SparkSkin_backgroundAlpha_test"
        xmlns:fx="http://ns.adobe.com/mxml/2009"
        xmlns:s="library://ns.adobe.com/flex/spark"
        xmlns:mx="library://ns.adobe.com/flex/halo"
        backgroundColor="red"&gt;

    &lt;fx:Style&gt;
        @namespace mx "library://ns.adobe.com/flex/halo";

        mx|TextArea {
            borderSkin: ClassReference("skins.CustomHaloTextAreaBorderSkin");
            left: 50;
            right: 50;
            top: 50;
            bottom: 50;
        }
    &lt;/fx:Style&gt;

    &lt;mx:TextArea id="textArea"&gt;
        &lt;mx:htmlText&gt;&lt;fx:String source="lorem.html" /&gt;&lt;/mx:htmlText&gt;
    &lt;/mx:TextArea&gt;

&lt;/s:Application&gt;
</pre>
<p>Or you can set the <code>borderSkin</code> style using ActionScript, as seen in the following example:</p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/spark/TextArea_SparkSkin_backgroundAlpha_test/bin/srcview/source/main3.mxml.html">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2009/06/09/changing-the-background-alpha-on-the-halo-textarea-control-in-flex-4/ --&gt;
&lt;s:Application name="TextArea_SparkSkin_backgroundAlpha_test"
        xmlns:fx="http://ns.adobe.com/mxml/2009"
        xmlns:s="library://ns.adobe.com/flex/spark"
        xmlns:mx="library://ns.adobe.com/flex/halo"
        backgroundColor="red"&gt;

    &lt;fx:Script&gt;
        &lt;![CDATA[
            import skins.CustomHaloTextAreaBorderSkin;

            private function btn_click(evt:MouseEvent):void {
                textArea.setStyle("borderSkin", CustomHaloTextAreaBorderSkin);
            }
        ]]&gt;
    &lt;/fx:Script&gt;

    &lt;s:Button id="btn"
            label="Set border skin"
            click="btn_click(event);"
            left="10"
            top="10" /&gt;

    &lt;mx:TextArea id="textArea"
            left="50" right="50"
            top="50" bottom="50"&gt;
        &lt;mx:htmlText&gt;&lt;fx:String source="lorem.html" /&gt;&lt;/mx:htmlText&gt;
    &lt;/mx:TextArea&gt;

&lt;/s:Application&gt;
</pre>
<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/spark/TextArea_SparkSkin_backgroundAlpha_test/bin/srcview/source/main5.mxml.html">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2009/06/09/changing-the-background-alpha-on-the-halo-textarea-control-in-flex-4/ --&gt;
&lt;s:Application name="TextArea_SparkSkin_backgroundAlpha_test"
        xmlns:fx="http://ns.adobe.com/mxml/2009"
        xmlns:s="library://ns.adobe.com/flex/spark"
        xmlns:mx="library://ns.adobe.com/flex/halo"
        backgroundColor="red"
        initialize="init();"&gt;

    &lt;fx:Script&gt;
        &lt;![CDATA[
            import mx.controls.TextArea;
            import skins.CustomHaloTextAreaBorderSkin;

            [Embed(source="lorem.html", mimeType="application/octet-stream")]
            private const lorem:Class;

            private var textArea:TextArea;

            private function init():void {
                textArea = new TextArea();
                textArea.htmlText = new lorem();
                textArea.left = 50;
                textArea.right = 50;
                textArea.top = 50;
                textArea.bottom = 50;
                textArea.setStyle("borderSkin", CustomHaloTextAreaBorderSkin);
                addElement(textArea);
            }
        ]]&gt;
    &lt;/fx:Script&gt;

&lt;/s:Application&gt;
</pre>
<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: 'Changing the background alpha on the Halo TextArea control in Flex 4 on FlexExamples.com',url: 'http://blog.flexexamples.com/2009/06/09/changing-the-background-alpha-on-the-halo-textarea-control-in-flex-4/',contentID: 'post-1105',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'backgroundAlpha,borderSkin,Gumbo',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/06/09/changing-the-background-alpha-on-the-halo-textarea-control-in-flex-4/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Setting the background alpha of the RichTextEditor text area in Flex</title>
		<link>http://blog.flexexamples.com/2008/08/25/setting-the-background-alpha-of-the-richtexteditor-text-area-in-flex/</link>
		<comments>http://blog.flexexamples.com/2008/08/25/setting-the-background-alpha-of-the-richtexteditor-text-area-in-flex/#comments</comments>
		<pubDate>Mon, 25 Aug 2008 07:55:30 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[RichTextEditor]]></category>
		<category><![CDATA[TextArea]]></category>
		<category><![CDATA[backgroundAlpha]]></category>
		<category><![CDATA[textAreaStyleName]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2008/08/25/setting-the-background-alpha-of-the-richtexteditor-text-area-in-flex/</guid>
		<description><![CDATA[<p>In a previous example, <a href="http://blog.flexexamples.com/2008/08/25/setting-the-background-color-of-the-richtexteditor-text-area-in-flex/">Setting the background color of the RichTextEditor text area in Flex</a>, we saw how you could set the background color of the RichTextEditor control&#8217;s nested TextArea control by setting the backgroundColor style.</p> <p>The following example shows how you can set the background alpha of the Flex RichTextEditor control&#8217;s nested TextArea [...]]]></description>
			<content:encoded><![CDATA[<p>In a previous example, <a href="http://blog.flexexamples.com/2008/08/25/setting-the-background-color-of-the-richtexteditor-text-area-in-flex/">Setting the background color of the RichTextEditor text area in Flex</a>, we saw how you could set the background color of the RichTextEditor control&#8217;s nested TextArea control by setting the <code>backgroundColor</code> style.</p>
<p>The following example shows how you can set the background alpha of the Flex RichTextEditor control&#8217;s nested TextArea control by setting the <code>backgroundAlpha</code> style.</p>
<p>Full code after the jump.</p>
<p><span id="more-764"></span></p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/RichTextEditor_textArea_backgroundAlpha_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/08/25/setting-the-background-alpha-of-the-richtexteditor-text-area-in-flex/ --&gt;
&lt;mx:Application name="RichTextEditor_textArea_backgroundAlpha_test"
        xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"&gt;

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

            private function colorPicker_change(evt:ColorPickerEvent):void {
                richTextEditor.textArea.setStyle("backgroundColor", evt.color);
            }

            private function slider_change(evt:SliderEvent):void {
                richTextEditor.textArea.setStyle("backgroundAlpha", evt.value);
            }
        ]]&gt;
    &lt;/mx:Script&gt;

    &lt;mx:ApplicationControlBar dock="true"&gt;
        &lt;mx:Form styleName="plain"&gt;
            &lt;mx:FormItem label="backgroundColor:"&gt;
                &lt;mx:ColorPicker id="colorPicker"
                        selectedColor="0xFFFFFF"
                        change="colorPicker_change(event);" /&gt;
            &lt;/mx:FormItem&gt;
            &lt;mx:FormItem label="backgroundAlpha:"&gt;
                &lt;mx:HSlider id="slider"
                        minimum="0.0"
                        maximum="1.0"
                        value="1.0"
                        snapInterval="0.01"
                        tickInterval="0.1"
                        liveDragging="true"
                        change="slider_change(event);" /&gt;
            &lt;/mx:FormItem&gt;
        &lt;/mx:Form&gt;
    &lt;/mx:ApplicationControlBar&gt;

    &lt;mx:RichTextEditor id="richTextEditor" /&gt;

&lt;/mx:Application&gt;
</pre>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/RichTextEditor_textArea_backgroundAlpha_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/RichTextEditor_textArea_backgroundAlpha_test/bin/main.html" width="100%" height="420"></iframe></p>
<p>You can also set the nested TextArea control&#8217;s background alpha in an external .CSS file or &lt;mx:Style /&gt; block, as seen in the following example:</p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/RichTextEditor_textArea_backgroundAlpha_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/08/25/setting-the-background-alpha-of-the-richtexteditor-text-area-in-flex/ --&gt;
&lt;mx:Application name="RichTextEditor_textArea_backgroundAlpha_test"
        xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"&gt;

    &lt;mx:Style&gt;
        RichTextEditor {
            textAreaStyleName: rteTextAreaStyles;
        }

        .rteTextAreaStyles {
            backgroundAlpha: 0.3; /* 30% */
            backgroundColor: red;
        }
    &lt;/mx:Style&gt;

    &lt;mx:RichTextEditor id="richTextEditor" /&gt;

&lt;/mx:Application&gt;
</pre>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Setting the background alpha of the RichTextEditor text area in Flex on FlexExamples.com',url: 'http://blog.flexexamples.com/2008/08/25/setting-the-background-alpha-of-the-richtexteditor-text-area-in-flex/',contentID: 'post-764',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'backgroundAlpha,textAreaStyleName',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/08/25/setting-the-background-alpha-of-the-richtexteditor-text-area-in-flex/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Changing the background alpha of a TextArea control in Flex</title>
		<link>http://blog.flexexamples.com/2008/08/18/changing-the-background-alpha-of-a-textarea-control-in-flex/</link>
		<comments>http://blog.flexexamples.com/2008/08/18/changing-the-background-alpha-of-a-textarea-control-in-flex/#comments</comments>
		<pubDate>Mon, 18 Aug 2008 15:37:05 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[TextArea]]></category>
		<category><![CDATA[backgroundAlpha]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2008/08/18/changing-the-background-alpha-of-a-textarea-control-in-flex/</guid>
		<description><![CDATA[<p>The following example shows how you can set the background alpha for a Flex TextArea control by setting the backgroundAlpha style.</p> <p>Full code after the jump.</p> <p></p> <p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/TextArea_backgroundAlpha_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/08/18/changing-the-background-alpha-of-a-textarea-control-in-flex/ --&#62; &#60;mx:Application name="TextArea_backgroundDisabledColor_test" xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" verticalAlign="middle"&#62; &#60;mx:String id="lorem" source="lorem.txt" /&#62; &#60;mx:ApplicationControlBar dock="true"&#62; &#60;mx:Form styleName="plain" backgroundAlpha="0.0"&#62; &#60;mx:FormItem label="backgroundAlpha:"&#62; &#60;mx:HSlider id="slider" [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can set the background alpha for a Flex TextArea control by setting the <code>backgroundAlpha</code> style.</p>
<p>Full code after the jump.</p>
<p><span id="more-750"></span></p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/TextArea_backgroundAlpha_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/08/18/changing-the-background-alpha-of-a-textarea-control-in-flex/ --&gt;
&lt;mx:Application name="TextArea_backgroundDisabledColor_test"
        xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"&gt;

    &lt;mx:String id="lorem" source="lorem.txt" /&gt;

    &lt;mx:ApplicationControlBar dock="true"&gt;
        &lt;mx:Form styleName="plain" backgroundAlpha="0.0"&gt;
            &lt;mx:FormItem label="backgroundAlpha:"&gt;
                &lt;mx:HSlider id="slider"
                        minimum="0.0"
                        maximum="1.0"
                        value="1.0"
                        snapInterval="0.01"
                        tickInterval="0.1"
                        liveDragging="true" /&gt;
            &lt;/mx:FormItem&gt;
            &lt;mx:FormItem label="enabled:"&gt;
                &lt;mx:CheckBox id="checkBox"
                        selected="true" /&gt;
            &lt;/mx:FormItem&gt;
        &lt;/mx:Form&gt;
    &lt;/mx:ApplicationControlBar&gt;

    &lt;mx:TextArea id="textArea"
            text="{lorem}"
            backgroundAlpha="{slider.value}"
            enabled="{checkBox.selected}"
            width="100%"
            height="100%" /&gt;

&lt;/mx:Application&gt;
</pre>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/TextArea_backgroundAlpha_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/TextArea_backgroundAlpha_test/bin/main.html" width="100%" height="200"></iframe></p>
<p>You can also set the <code>backgroundAlpha</code> style in an external .CSS file or &lt;mx:Style /&gt; block, as seen in the following example:</p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/TextArea_backgroundAlpha_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/08/18/changing-the-background-alpha-of-a-textarea-control-in-flex/ --&gt;
&lt;mx:Application name="TextArea_backgroundDisabledColor_test"
        xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"&gt;

    &lt;mx:Style&gt;
        TextArea {
            backgroundAlpha: 0.0;
        }
    &lt;/mx:Style&gt;

    &lt;mx:String id="lorem" source="lorem.txt" /&gt;

    &lt;mx:ApplicationControlBar dock="true"&gt;
        &lt;mx:Form styleName="plain" backgroundAlpha="0.0"&gt;
            &lt;mx:FormItem label="enabled:"&gt;
                &lt;mx:CheckBox id="checkBox"
                        selected="true" /&gt;
            &lt;/mx:FormItem&gt;
        &lt;/mx:Form&gt;
    &lt;/mx:ApplicationControlBar&gt;

    &lt;mx:TextArea id="textArea"
            text="{lorem}"
            enabled="{checkBox.selected}"
            width="100%"
            height="100%" /&gt;

&lt;/mx:Application&gt;
</pre>
<p>Or, you can set the <code>backgroundAlpha</code> style using ActionScript, as seen in the following example:</p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/TextArea_backgroundAlpha_test/bin/srcview/source/main3.mxml.html">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2008/08/18/changing-the-background-alpha-of-a-textarea-control-in-flex/ --&gt;
&lt;mx:Application name="TextArea_backgroundDisabledColor_test"
        xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"&gt;

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

            private function slider_change(evt:SliderEvent):void {
                textArea.setStyle("backgroundAlpha", evt.value);
            }
        ]]&gt;
    &lt;/mx:Script&gt;

    &lt;mx:String id="lorem" source="lorem.txt" /&gt;

    &lt;mx:ApplicationControlBar dock="true"&gt;
        &lt;mx:Form styleName="plain" backgroundAlpha="0.0"&gt;
            &lt;mx:FormItem label="backgroundAlpha:"&gt;
                &lt;mx:HSlider id="slider"
                        minimum="0.0"
                        maximum="1.0"
                        value="1.0"
                        snapInterval="0.01"
                        tickInterval="0.1"
                        liveDragging="true"
                        change="slider_change(event);" /&gt;
            &lt;/mx:FormItem&gt;
            &lt;mx:FormItem label="enabled:"&gt;
                &lt;mx:CheckBox id="checkBox"
                        selected="true" /&gt;
            &lt;/mx:FormItem&gt;
        &lt;/mx:Form&gt;
    &lt;/mx:ApplicationControlBar&gt;

    &lt;mx:TextArea id="textArea"
            text="{lorem}"
            enabled="{checkBox.selected}"
            width="100%"
            height="100%" /&gt;

&lt;/mx:Application&gt;
</pre>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Changing the background alpha of a TextArea control in Flex on FlexExamples.com',url: 'http://blog.flexexamples.com/2008/08/18/changing-the-background-alpha-of-a-textarea-control-in-flex/',contentID: 'post-750',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'backgroundAlpha',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/08/18/changing-the-background-alpha-of-a-textarea-control-in-flex/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Setting the background color and background alpha for a NumericStepper control in Flex</title>
		<link>http://blog.flexexamples.com/2008/05/23/setting-the-background-color-and-background-alpha-for-a-numericstepper-control-in-flex/</link>
		<comments>http://blog.flexexamples.com/2008/05/23/setting-the-background-color-and-background-alpha-for-a-numericstepper-control-in-flex/#comments</comments>
		<pubDate>Sat, 24 May 2008 01:06:34 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[NumericStepper]]></category>
		<category><![CDATA[backgroundAlpha]]></category>
		<category><![CDATA[backgroundColor]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2008/05/23/setting-the-background-color-and-background-alpha-for-a-numericstepper-control-in-flex/</guid>
		<description><![CDATA[<p>The following example shows how you can set the background color and background alpha for a Flex NumericStepper control by setting the backgroundColor and backgroundAlpha styles.</p> <p>Full code after the jump.</p> <p></p> <p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/NumericStepper_backgroundColor_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-background-color-and-background-alpha-for-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:ApplicationControlBar dock="true"&#62; &#60;mx:Form styleName="plain"&#62; &#60;mx:FormItem label="backgroundAlpha:"&#62; &#60;mx:HSlider id="slider" [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can set the background color and background alpha for a Flex NumericStepper control by setting the <code>backgroundColor</code> and <code>backgroundAlpha</code> styles.</p>
<p>Full code after the jump.</p>
<p><span id="more-640"></span></p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/NumericStepper_backgroundColor_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-background-color-and-background-alpha-for-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:ApplicationControlBar dock="true"&gt;
        &lt;mx:Form styleName="plain"&gt;
            &lt;mx:FormItem label="backgroundAlpha:"&gt;
                &lt;mx:HSlider id="slider"
                        minimum="0.0"
                        maximum="1.0"
                        value="1.0"
                        snapInterval="0.1"
                        tickInterval="0.1"
                        liveDragging="true" /&gt;
            &lt;/mx:FormItem&gt;
            &lt;mx:FormItem label="backgroundColor:"&gt;
                &lt;mx:ColorPicker id="colorPicker"
                        selectedColor="white" /&gt;
            &lt;/mx:FormItem&gt;
        &lt;/mx:Form&gt;
    &lt;/mx:ApplicationControlBar&gt;

    &lt;mx:NumericStepper id="numericStepper"
            backgroundAlpha="{slider.value}"
            backgroundColor="{colorPicker.selectedColor}" /&gt;

&lt;/mx:Application&gt;
</pre>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/NumericStepper_backgroundColor_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_backgroundColor_test/bin/main.html" width="100%" height="300"></iframe></p>
<p>You can also set the <code>backgroundAlpha</code> and <code>backgroundColor</code> styles in an external .CSS file or &lt;mx:Style /&gt; block, as seen in the following example:</p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/NumericStepper_backgroundColor_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-background-color-and-background-alpha-for-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 {
            backgroundAlpha: 0.5;
            backgroundColor: red;
        }
    &lt;/mx:Style&gt;

    &lt;mx:NumericStepper id="numericStepper" /&gt;

&lt;/mx:Application&gt;
</pre>
<p>Or you can set the <code>backgroundAlpha</code> and <code>backgroundColor</code> styles using ActionScript, as seen in the following example:</p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/NumericStepper_backgroundColor_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-background-color-and-background-alpha-for-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[
            private function init():void {
                numericStepper.setStyle("backgroundAlpha", 0.5);
                numericStepper.setStyle("backgroundColor", "red");
            }
        ]]&gt;
    &lt;/mx:Script&gt;

    &lt;mx:NumericStepper id="numericStepper"
            creationComplete="init();" /&gt;

&lt;/mx:Application&gt;
</pre>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Setting the background color and background alpha for a NumericStepper control in Flex on FlexExamples.com',url: 'http://blog.flexexamples.com/2008/05/23/setting-the-background-color-and-background-alpha-for-a-numericstepper-control-in-flex/',contentID: 'post-640',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'backgroundAlpha,backgroundColor',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-background-color-and-background-alpha-for-a-numericstepper-control-in-flex/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Changing the background color of the DateChooser control in Flex</title>
		<link>http://blog.flexexamples.com/2008/05/02/changing-the-background-color-of-the-datechooser-control-in-flex/</link>
		<comments>http://blog.flexexamples.com/2008/05/02/changing-the-background-color-of-the-datechooser-control-in-flex/#comments</comments>
		<pubDate>Sat, 03 May 2008 06:32:20 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[DateChooser]]></category>
		<category><![CDATA[backgroundAlpha]]></category>
		<category><![CDATA[backgroundColor]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2008/05/02/changing-the-background-color-of-the-datechooser-control-in-flex/</guid>
		<description><![CDATA[<p>The following example shows how you can change the background color of a Flex DateChooser control by setting the backgroundColor and backgroundAlpha styles.</p> <p>Full code after the jump.</p> <p></p> <p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/DateChooser_backgroundColor_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/02/changing-the-background-color-of-the-datechooser-control-in-flex/ --&#62; &#60;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" verticalAlign="middle" backgroundColor="white"&#62; &#60;mx:ApplicationControlBar dock="true"&#62; &#60;mx:Form styleName="plain"&#62; &#60;mx:FormItem label="backgroundAlpha:"&#62; &#60;mx:HSlider id="slider" minimum="0" maximum="1" value="1" [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can change the background color of a Flex DateChooser control by setting the <code>backgroundColor</code> and <code>backgroundAlpha</code> styles.</p>
<p>Full code after the jump.</p>
<p><span id="more-612"></span></p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/DateChooser_backgroundColor_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/02/changing-the-background-color-of-the-datechooser-control-in-flex/ --&gt;
&lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"&gt;

    &lt;mx:ApplicationControlBar dock="true"&gt;
        &lt;mx:Form styleName="plain"&gt;
            &lt;mx:FormItem label="backgroundAlpha:"&gt;
                &lt;mx:HSlider id="slider"
                        minimum="0"
                        maximum="1"
                        value="1"
                        liveDragging="true"
                        snapInterval="0.01"
                        tickInterval="0.1" /&gt;
            &lt;/mx:FormItem&gt;
            &lt;mx:FormItem label="backgroundColor:"&gt;
                &lt;mx:ColorPicker id="colorPicker"
                        selectedColor="white" /&gt;
            &lt;/mx:FormItem&gt;
        &lt;/mx:Form&gt;
    &lt;/mx:ApplicationControlBar&gt;

    &lt;mx:DateChooser id="dateChooser"
            backgroundAlpha="{slider.value}"
            backgroundColor="{colorPicker.selectedColor}" /&gt;

&lt;/mx:Application&gt;
</pre>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/DateChooser_backgroundColor_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/DateChooser_backgroundColor_test/bin/main.html" width="100%" height="300"></iframe></p>
<p>Due to popular demand, here&#8217;s the &#8220;same&#8221; example, but in ActionScript instead of MXML:</p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/DateChooser_backgroundColor_test_2/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/02/changing-the-background-color-of-the-datechooser-control-in-flex/ --&gt;
&lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"
        creationComplete="init();"&gt;

    &lt;mx:Script&gt;
        &lt;![CDATA[
            import mx.containers.ApplicationControlBar;
            import mx.containers.Form;
            import mx.containers.FormItem;
            import mx.controls.ColorPicker;
            import mx.controls.DateChooser;
            import mx.controls.HSlider;
            import mx.events.ColorPickerEvent;
            import mx.events.SliderEvent;

            private var appControlBar:ApplicationControlBar;
            private var form:Form;
            private var slider:HSlider;
            private var colorPicker:ColorPicker;
            private var dateChooser:DateChooser;

            private function init():void {
                slider = new HSlider();
                slider.minimum = 0;
                slider.maximum = 1;
                slider.value = 1;
                slider.liveDragging = true;
                slider.snapInterval = 0.01;
                slider.tickInterval = 0.1;
                slider.addEventListener(SliderEvent.CHANGE, slider_change);

                colorPicker = new ColorPicker();
                colorPicker.selectedColor = 0xFFFFFF;
                colorPicker.addEventListener(ColorPickerEvent.CHANGE, colorPicker_change);

                var alphaFormItem:FormItem = new FormItem();
                alphaFormItem.label = "backgroundAlpha:";
                alphaFormItem.addChild(slider);

                var colorFormItem:FormItem = new FormItem();
                colorFormItem.label = "backgroundColor:";
                colorFormItem.addChild(colorPicker);

                form = new Form();
                form.styleName = "plain";
                form.addChild(alphaFormItem);
                form.addChild(colorFormItem);

                appControlBar = new ApplicationControlBar();
                appControlBar.dock = true;
                appControlBar.addChild(form);
                addChild(appControlBar);

                dateChooser = new DateChooser();
                dateChooser.setStyle("backgroundAlpha", slider.value);
                dateChooser.setStyle("backgroundColor", colorPicker.selectedColor);
                addChild(dateChooser);
            }

            private function slider_change(evt:SliderEvent):void {
                dateChooser.setStyle("backgroundAlpha", evt.value);
            }

            private function colorPicker_change(evt:ColorPickerEvent):void {
                dateChooser.setStyle("backgroundColor", evt.color);
            }
        ]]&gt;
    &lt;/mx:Script&gt;

&lt;/mx:Application&gt;
</pre>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/DateChooser_backgroundColor_test_2/bin/srcview/index.html">View source</a> is enabled in the following example.</p>
<p><iframe src="http://blog.flexexamples.com/wp-content/uploads/DateChooser_backgroundColor_test_2/bin/main.html" width="100%" height="300"></iframe></p>
<p>You can also set the <code>backgroundColor</code> and <code>backgroundAlpha</code> styles in an external .CSS file or within a &lt;mx:Style /&gt; block, as seen in the following snippet:</p>
<pre class="code">
&lt;mx:Style&gt;
    DateChooser {
        backgroundColor: red;
        backgroundAlpha: 0.5;
    }
&lt;/mx:Style&gt;
</pre>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Changing the background color of the DateChooser control in Flex on FlexExamples.com',url: 'http://blog.flexexamples.com/2008/05/02/changing-the-background-color-of-the-datechooser-control-in-flex/',contentID: 'post-612',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'backgroundAlpha,backgroundColor',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/02/changing-the-background-color-of-the-datechooser-control-in-flex/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

