<?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; beta2</title>
	<atom:link href="http://blog.flexexamples.com/category/spark/beta2/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 border color on a Spark DropDownList control in Flex 4</title>
		<link>http://blog.flexexamples.com/2010/03/20/setting-the-border-color-on-a-spark-dropdownlist-control-in-flex-4/</link>
		<comments>http://blog.flexexamples.com/2010/03/20/setting-the-border-color-on-a-spark-dropdownlist-control-in-flex-4/#comments</comments>
		<pubDate>Sat, 20 Mar 2010 17:09:04 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[beta2]]></category>
		<category><![CDATA[DropDownList (Spark)]]></category>
		<category><![CDATA[borderColor]]></category>
		<category><![CDATA[Gumbo]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/?p=2624</guid>
		<description><![CDATA[<p>In a previous example, <a href="http://blog.flexexamples.com/2010/03/20/setting-the-border-alpha-on-a-spark-dropdownlist-control-in-flex-4/">&#8220;Setting the border alpha on a Spark DropDownList control in Flex 4&#8243;</a>, we saw how you could set the border alpha on a Spark DropDownList control&#8217;s popup menu in Flex 4 by setting the borderAlpha style.</p> <p>The following example shows how you can set the border color on a Spark [...]]]></description>
			<content:encoded><![CDATA[<p>In a previous example, <a href="http://blog.flexexamples.com/2010/03/20/setting-the-border-alpha-on-a-spark-dropdownlist-control-in-flex-4/">&#8220;Setting the border alpha on a Spark DropDownList control in Flex 4&#8243;</a>, we saw how you could set the border alpha on a Spark DropDownList control&#8217;s popup menu in Flex 4 by setting the <code>borderAlpha</code> style.</p>
<p>The following example shows how you can set the border color on a Spark DropDownList control&#8217;s popup menu in Flex 4 by setting the <code>borderColor</code> style.</p>
<p><span id="more-2624"></span></p>
<p class="alert">The following example(s) require Flash Player 10 and the Adobe Flex 4 SDK. To download the Adobe Flash Builder 4 trial, see <a href="http://bit.ly/crThlI">http://www.adobe.com/products/flex/</a>. To download the latest nightly build of the Flex 4 SDK, see <a href="http://bit.ly/Flex4SDK">http://opensource.adobe.com/wiki/display/flexsdk/Download+Flex+4</a>.<br/><strong>For more information on getting started with Flex 4 and Flash Builder 4, see the official <a href="http://bit.ly/dCkecm">Adobe Flex Team blog</a>.</strong></p>

<div class="wp_syntax"><div class="code"><pre class="mxml" style="font-family:monospace;"><span style="color: #000000;">&lt;?xml version=<span style="color: #ff0000;">&quot;1.0&quot;</span> encoding=<span style="color: #ff0000;">&quot;utf-8&quot;</span>?<span style="color: #7400FF;">&gt;</span></span>
<span style="color: #000000;"><span style="color: #808080; font-style: italic;">&lt;!-- http://blog.flexexamples.com/2010/03/20/setting-the-border-color-on-a-spark-dropdownlist-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_DropDownList_borderColor_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;borderColor:&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> change=<span style="color: #ff0000;">&quot;ddl.openDropDown();&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:FormItem</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:Form</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:controlBarContent</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:DropDownList</span> id=<span style="color: #ff0000;">&quot;ddl&quot;</span></span>
<span style="color: #000000;">            borderColor=<span style="color: #ff0000;">&quot;{clrPckr.selectedColor}&quot;</span></span>
<span style="color: #000000;">            requireSelection=<span style="color: #ff0000;">&quot;true&quot;</span></span>
<span style="color: #000000;">            dropShadowVisible=<span style="color: #ff0000;">&quot;false&quot;</span></span>
<span style="color: #000000;">            horizontalCenter=<span style="color: #ff0000;">&quot;0&quot;</span> top=<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:dataProvider</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:ArrayList</span> source=<span style="color: #ff0000;">&quot;[One,Two,Three,Four,Five,Six,Seven]&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:dataProvider</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:DropDownList</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>

<div span="googleAdsLeaderboard">
<script type="text/javascript"><!--
google_ad_client = "pub-3325829455487492";
/* 728x90, created 7/15/09 */
google_ad_slot = "6403511741";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
<br />
</div>
<p class="information"><a href="http://dl.dropbox.com/u/4509565/FlexExamples_com/Spark_DropDownList_borderColor_test/srcview/index.html">View source</a> is enabled in the following example.</p>
<p><iframe src="http://dl.dropbox.com/u/4509565/FlexExamples_com/Spark_DropDownList_borderColor_test/main.html" width="100%" height="300"></iframe></p>
<p>You can also set the <code>borderColor</code> style in an external .CSS file or a &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/03/20/setting-the-border-color-on-a-spark-dropdownlist-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_DropDownList_borderColor_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>
&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|DropDownList {
            borderColor: haloOrange;
        }
    <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:DropDownList</span> id=<span style="color: #ff0000;">&quot;ddl&quot;</span></span>
<span style="color: #000000;">            requireSelection=<span style="color: #ff0000;">&quot;true&quot;</span></span>
<span style="color: #000000;">            dropShadowVisible=<span style="color: #ff0000;">&quot;false&quot;</span></span>
<span style="color: #000000;">            horizontalCenter=<span style="color: #ff0000;">&quot;0&quot;</span> top=<span style="color: #ff0000;">&quot;20&quot;</span></span>
<span style="color: #000000;">            creationComplete=<span style="color: #ff0000;">&quot;ddl.openDropDown();&quot;</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:dataProvider</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:ArrayList</span> source=<span style="color: #ff0000;">&quot;[One,Two,Three,Four,Five,Six,Seven]&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:dataProvider</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:DropDownList</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>borderColor</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/03/20/setting-the-border-color-on-a-spark-dropdownlist-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_DropDownList_borderColor_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;borderColor:&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;">                        change=<span style="color: #ff0000;">&quot;clrPckr_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: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;">            import mx.events.ColorPickerEvent;</span>
&nbsp;
<span style="color: #000000;">            protected function clrPckr_changeHandler<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;">                ddl.setStyle<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;borderColor&quot;</span>, evt.color<span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                ddl.openDropDown<span style="color: #66cc66;">&#40;</span><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:DropDownList</span> id=<span style="color: #ff0000;">&quot;ddl&quot;</span></span>
<span style="color: #000000;">            requireSelection=<span style="color: #ff0000;">&quot;true&quot;</span></span>
<span style="color: #000000;">            dropShadowVisible=<span style="color: #ff0000;">&quot;false&quot;</span></span>
<span style="color: #000000;">            horizontalCenter=<span style="color: #ff0000;">&quot;0&quot;</span> top=<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:dataProvider</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:ArrayList</span> source=<span style="color: #ff0000;">&quot;[One,Two,Three,Four,Five,Six,Seven]&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:dataProvider</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:DropDownList</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 border color on a Spark DropDownList control in Flex 4 on FlexExamples.com',url: 'http://blog.flexexamples.com/2010/03/20/setting-the-border-color-on-a-spark-dropdownlist-control-in-flex-4/',contentID: 'post-2624',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'borderColor,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/2010/03/20/setting-the-border-color-on-a-spark-dropdownlist-control-in-flex-4/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Setting the border alpha on a Spark DropDownList control in Flex 4</title>
		<link>http://blog.flexexamples.com/2010/03/20/setting-the-border-alpha-on-a-spark-dropdownlist-control-in-flex-4/</link>
		<comments>http://blog.flexexamples.com/2010/03/20/setting-the-border-alpha-on-a-spark-dropdownlist-control-in-flex-4/#comments</comments>
		<pubDate>Sat, 20 Mar 2010 07:26:09 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[beta2]]></category>
		<category><![CDATA[DropDownList (Spark)]]></category>
		<category><![CDATA[borderAlpha]]></category>
		<category><![CDATA[Gumbo]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/?p=2621</guid>
		<description><![CDATA[<p>The following example shows how you can set the border alpha on a Spark DropDownList control&#8217;s popup menu in Flex 4 by setting the borderAlpha style.</p> <p></p> &#60;?xml version=&#34;1.0&#34; encoding=&#34;utf-8&#34;?&#62; &#60;!-- http://blog.flexexamples.com/2010/03/20/setting-the-border-alpha-on-a-spark-dropdownlist-control-in-flex-4/ --&#62; &#60;s:Application name=&#34;Spark_DropDownList_borderAlpha_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:controlBarContent&#62; &#60;s:Label text=&#34;borderAlpha:&#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; change=&#34;ddl.openDropDown();&#34; /&#62; &#60;/s:controlBarContent&#62; &#160; &#60;s:DropDownList id=&#34;ddl&#34; [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can set the border alpha on a Spark DropDownList control&#8217;s popup menu in Flex 4 by setting the <code>borderAlpha</code> style.</p>
<p><span id="more-2621"></span></p>
<p class="alert">The following example(s) require Flash Player 10 and the Adobe Flex 4 SDK. To download the Adobe Flash Builder 4 trial, see <a href="http://bit.ly/crThlI">http://www.adobe.com/products/flex/</a>. To download the latest nightly build of the Flex 4 SDK, see <a href="http://bit.ly/Flex4SDK">http://opensource.adobe.com/wiki/display/flexsdk/Download+Flex+4</a>.<br/><strong>For more information on getting started with Flex 4 and Flash Builder 4, see the official <a href="http://bit.ly/dCkecm">Adobe Flex Team blog</a>.</strong></p>

<div class="wp_syntax"><div class="code"><pre class="mxml" style="font-family:monospace;"><span style="color: #000000;">&lt;?xml version=<span style="color: #ff0000;">&quot;1.0&quot;</span> encoding=<span style="color: #ff0000;">&quot;utf-8&quot;</span>?<span style="color: #7400FF;">&gt;</span></span>
<span style="color: #000000;"><span style="color: #808080; font-style: italic;">&lt;!-- http://blog.flexexamples.com/2010/03/20/setting-the-border-alpha-on-a-spark-dropdownlist-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_DropDownList_borderAlpha_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;s:Label</span> text=<span style="color: #ff0000;">&quot;borderAlpha:&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;ddl.openDropDown();&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>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:DropDownList</span> id=<span style="color: #ff0000;">&quot;ddl&quot;</span></span>
<span style="color: #000000;">            borderAlpha=<span style="color: #ff0000;">&quot;{sl.value}&quot;</span></span>
<span style="color: #000000;">            requireSelection=<span style="color: #ff0000;">&quot;true&quot;</span></span>
<span style="color: #000000;">            dropShadowVisible=<span style="color: #ff0000;">&quot;false&quot;</span></span>
<span style="color: #000000;">            horizontalCenter=<span style="color: #ff0000;">&quot;0&quot;</span> top=<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:dataProvider</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:ArrayList</span> source=<span style="color: #ff0000;">&quot;[One,Two,Three,Four,Five,Six,Seven]&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:dataProvider</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:DropDownList</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 border alpha on a Spark DropDownList control in Flex 4 on FlexExamples.com',url: 'http://blog.flexexamples.com/2010/03/20/setting-the-border-alpha-on-a-spark-dropdownlist-control-in-flex-4/',contentID: 'post-2621',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'borderAlpha,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/2010/03/20/setting-the-border-alpha-on-a-spark-dropdownlist-control-in-flex-4/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Skinning the track on a Spark HSlider control in Flex 4</title>
		<link>http://blog.flexexamples.com/2010/03/19/skinning-the-track-on-a-spark-hslider-control-in-flex-4/</link>
		<comments>http://blog.flexexamples.com/2010/03/19/skinning-the-track-on-a-spark-hslider-control-in-flex-4/#comments</comments>
		<pubDate>Fri, 19 Mar 2010 15:39:15 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[beta2]]></category>
		<category><![CDATA[HSlider (Spark)]]></category>
		<category><![CDATA[#track]]></category>
		<category><![CDATA[Gumbo]]></category>
		<category><![CDATA[skinClass]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/?p=2612</guid>
		<description><![CDATA[<p>The following example shows how you can reskin the track on a Spark HSlider control in Flex 4 by creating a custom HSlider skin and specifying the track skin part&#8217;s skinClass style.</p> <p></p> &#60;?xml version=&#34;1.0&#34; encoding=&#34;utf-8&#34;?&#62; &#60;!-- http://blog.flexexamples.com/2010/03/19/skinning-the-track-on-a-spark-hslider-control-in-flex-4/ --&#62; &#60;s:Application name=&#34;Spark_HSlider_track_skinClass_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; &#160; &#60;s:HSlider id=&#34;sldr&#34; skinClass=&#34;YeHSliderSkin&#34; horizontalCenter=&#34;0&#34; verticalCenter=&#34;0&#34; /&#62; &#160; &#60;/s:Application&#62; <p>And the [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can reskin the track on a Spark HSlider control in Flex 4 by creating a custom HSlider skin and specifying the track skin part&#8217;s <code>skinClass</code> style.</p>
<p><span id="more-2612"></span></p>
<p class="alert">The following example(s) require Flash Player 10 and the Adobe Flex 4 SDK. To download the Adobe Flash Builder 4 trial, see <a href="http://bit.ly/crThlI">http://www.adobe.com/products/flex/</a>. To download the latest nightly build of the Flex 4 SDK, see <a href="http://bit.ly/Flex4SDK">http://opensource.adobe.com/wiki/display/flexsdk/Download+Flex+4</a>.<br/><strong>For more information on getting started with Flex 4 and Flash Builder 4, see the official <a href="http://bit.ly/dCkecm">Adobe Flex Team blog</a>.</strong></p>

<div class="wp_syntax"><div class="code"><pre class="mxml" style="font-family:monospace;"><span style="color: #000000;">&lt;?xml version=<span style="color: #ff0000;">&quot;1.0&quot;</span> encoding=<span style="color: #ff0000;">&quot;utf-8&quot;</span>?<span style="color: #7400FF;">&gt;</span></span>
<span style="color: #000000;"><span style="color: #808080; font-style: italic;">&lt;!-- http://blog.flexexamples.com/2010/03/19/skinning-the-track-on-a-spark-hslider-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_HSlider_track_skinClass_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>
&nbsp;
    <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;">            skinClass=<span style="color: #ff0000;">&quot;YeHSliderSkin&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 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 HSlider skin class, <em>YeHSliderSkin.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/03/19/skinning-the-track-on-a-spark-hslider-control-in-flex-4/ --&gt;</span></span>
<span style="color: #000000;"><span style="color: #7400FF;">&lt;s:SparkSkin</span> name=<span style="color: #ff0000;">&quot;YeHSliderSkin&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;">        minHeight=<span style="color: #ff0000;">&quot;11&quot;</span></span>
<span style="color: #000000;">        alpha.disabled=<span style="color: #ff0000;">&quot;0.5&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>
        <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: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.HSlider&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 slider, the skin itself is colorized but the individual parts are not. */</span>
<span style="color: #000000;">            static private const exclusions:Array = <span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">&quot;track&quot;</span>, <span style="color: #ff0000;">&quot;thumb&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>
<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;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;">            override protected function measure<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:void <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">                var thumbPos:Number = thumb.getLayoutBoundsX<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                thumb.setLayoutBoundsPosition<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">0</span>, thumb.getLayoutBoundsY<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                super.measure<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                thumb.setLayoutBoundsPosition<span style="color: #66cc66;">&#40;</span>thumbPos, thumb.getLayoutBoundsY<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><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;fx:Declarations</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Component</span> id=<span style="color: #ff0000;">&quot;dataTip&quot;</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:DataRenderer</span> minHeight=<span style="color: #ff0000;">&quot;24&quot;</span> minWidth=<span style="color: #ff0000;">&quot;40&quot;</span> y=<span style="color: #ff0000;">&quot;-34&quot;</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Rect</span> top=<span style="color: #ff0000;">&quot;0&quot;</span> left=<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> color=<span style="color: #ff0000;">&quot;0x000000&quot;</span> alpha=<span style="color: #ff0000;">&quot;.9&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:filters</span><span style="color: #7400FF;">&gt;</span></span>
                        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:DropShadowFilter</span> angle=<span style="color: #ff0000;">&quot;90&quot;</span> color=<span style="color: #ff0000;">&quot;0x999999&quot;</span> distance=<span style="color: #ff0000;">&quot;3&quot;</span><span style="color: #7400FF;">/&gt;</span></span>
                    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:filters</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:Label</span> id=<span style="color: #ff0000;">&quot;labelDisplay&quot;</span> text=<span style="color: #ff0000;">&quot;{data}&quot;</span></span>
<span style="color: #000000;">                         horizontalCenter=<span style="color: #ff0000;">&quot;0&quot;</span> verticalCenter=<span style="color: #ff0000;">&quot;1&quot;</span></span>
<span style="color: #000000;">                         left=<span style="color: #ff0000;">&quot;5&quot;</span> right=<span style="color: #ff0000;">&quot;5&quot;</span> top=<span style="color: #ff0000;">&quot;5&quot;</span> bottom=<span style="color: #ff0000;">&quot;5&quot;</span></span>
<span style="color: #000000;">                         textAlign=<span style="color: #ff0000;">&quot;center&quot;</span> verticalAlign=<span style="color: #ff0000;">&quot;middle&quot;</span></span>
<span style="color: #000000;">                         fontWeight=<span style="color: #ff0000;">&quot;normal&quot;</span> color=<span style="color: #ff0000;">&quot;white&quot;</span> fontSize=<span style="color: #ff0000;">&quot;11&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:DataRenderer</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/fx:Component</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/fx:Declarations</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Button</span> id=<span style="color: #ff0000;">&quot;track&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;">              minWidth=<span style="color: #ff0000;">&quot;33&quot;</span> width=<span style="color: #ff0000;">&quot;100&quot;</span></span>
<span style="color: #000000;">              skinClass=<span style="color: #ff0000;">&quot;YeHSliderTrackSkin&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Button</span> id=<span style="color: #ff0000;">&quot;thumb&quot;</span></span>
<span style="color: #000000;">              top=<span style="color: #ff0000;">&quot;0&quot;</span> bottom=<span style="color: #ff0000;">&quot;0&quot;</span></span>
<span style="color: #000000;">              width=<span style="color: #ff0000;">&quot;11&quot;</span> height=<span style="color: #ff0000;">&quot;11&quot;</span></span>
<span style="color: #000000;">              skinClass=<span style="color: #ff0000;">&quot;spark.skins.spark.HSliderThumbSkin&quot;</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>And the custom Spark HSlider track skin class, <em>YeHSliderTrackSkin.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/03/19/skinning-the-track-on-a-spark-hslider-control-in-flex-4/ --&gt;</span></span>
<span style="color: #000000;"><span style="color: #7400FF;">&lt;s:SparkSkin</span> name=<span style="color: #ff0000;">&quot;YeHSliderTrackSkin&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 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>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:State</span> name=<span style="color: #ff0000;">&quot;up&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;down&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;over&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: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.Button&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;">            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>
<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;!-- border --&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> bottom=<span style="color: #ff0000;">&quot;0&quot;</span> radiusX=<span style="color: #ff0000;">&quot;{hostComponent.height/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;0x000000&quot;</span> alpha=<span style="color: #ff0000;">&quot;0.55&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;0xFFFFFF&quot;</span> alpha=<span style="color: #ff0000;">&quot;0.55&quot;</span> ratio=<span style="color: #ff0000;">&quot;0.8&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;!-- 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;1&quot;</span> bottom=<span style="color: #ff0000;">&quot;1&quot;</span> radiusX=<span style="color: #ff0000;">&quot;{hostComponent.height/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;0xCACACA&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;!-- hit area --&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> 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>
&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: 'Skinning the track on a Spark HSlider control in Flex 4 on FlexExamples.com',url: 'http://blog.flexexamples.com/2010/03/19/skinning-the-track-on-a-spark-hslider-control-in-flex-4/',contentID: 'post-2612',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: '#track,Gumbo,skinClass',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/03/19/skinning-the-track-on-a-spark-hslider-control-in-flex-4/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Setting the line height on a Spark RichText control in Flex 4</title>
		<link>http://blog.flexexamples.com/2010/03/18/setting-the-line-height-on-a-spark-richtext-control-in-flex-4/</link>
		<comments>http://blog.flexexamples.com/2010/03/18/setting-the-line-height-on-a-spark-richtext-control-in-flex-4/#comments</comments>
		<pubDate>Thu, 18 Mar 2010 23:47:18 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[beta2]]></category>
		<category><![CDATA[RichText (Spark)]]></category>
		<category><![CDATA[Gumbo]]></category>
		<category><![CDATA[lineHeight]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/?p=2605</guid>
		<description><![CDATA[<p>The following example shows how you can set the line height on a Spark RichText control in Flex 4 by setting the lineHeight style.</p> <p></p> &#60;?xml version=&#34;1.0&#34; encoding=&#34;utf-8&#34;?&#62; &#60;!-- http://blog.flexexamples.com/2010/03/18/setting-the-line-height-on-a-spark-richtext-control-in-flex-4/ --&#62; &#60;s:Application name=&#34;Spark_RichText_lineHeight_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:controlBarContent&#62; &#60;mx:Form&#62; &#60;mx:FormItem label=&#34;lineHeight:&#34;&#62; &#60;s:HSlider id=&#34;sl&#34; minimum=&#34;10&#34; maximum=&#34;24&#34; value=&#34;14&#34; /&#62; &#60;/mx:FormItem&#62; &#60;/mx:Form&#62; &#60;/s:controlBarContent&#62; &#160; &#60;s:RichText id=&#34;richTxt&#34; lineHeight=&#34;{sl.value}&#34; textAlign=&#34;justify&#34; left=&#34;20&#34; [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can set the line height on a Spark RichText control in Flex 4 by setting the <code>lineHeight</code> style.</p>
<p><span id="more-2605"></span></p>
<p class="alert">The following example(s) require Flash Player 10 and the Adobe Flex 4 SDK. To download the Adobe Flash Builder 4 trial, see <a href="http://bit.ly/crThlI">http://www.adobe.com/products/flex/</a>. To download the latest nightly build of the Flex 4 SDK, see <a href="http://bit.ly/Flex4SDK">http://opensource.adobe.com/wiki/display/flexsdk/Download+Flex+4</a>.<br/><strong>For more information on getting started with Flex 4 and Flash Builder 4, see the official <a href="http://bit.ly/dCkecm">Adobe Flex Team blog</a>.</strong></p>

<div class="wp_syntax"><div class="code"><pre class="mxml" style="font-family:monospace;"><span style="color: #000000;">&lt;?xml version=<span style="color: #ff0000;">&quot;1.0&quot;</span> encoding=<span style="color: #ff0000;">&quot;utf-8&quot;</span>?<span style="color: #7400FF;">&gt;</span></span>
<span style="color: #000000;"><span style="color: #808080; font-style: italic;">&lt;!-- http://blog.flexexamples.com/2010/03/18/setting-the-line-height-on-a-spark-richtext-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_RichText_lineHeight_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;lineHeight:&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> minimum=<span style="color: #ff0000;">&quot;10&quot;</span> maximum=<span style="color: #ff0000;">&quot;24&quot;</span> value=<span style="color: #ff0000;">&quot;14&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:FormItem</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:Form</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:controlBarContent</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:RichText</span> id=<span style="color: #ff0000;">&quot;richTxt&quot;</span></span>
<span style="color: #000000;">            lineHeight=<span style="color: #ff0000;">&quot;{sl.value}&quot;</span></span>
<span style="color: #000000;">            textAlign=<span style="color: #ff0000;">&quot;justify&quot;</span></span>
<span style="color: #000000;">            left=<span style="color: #ff0000;">&quot;20&quot;</span> right=<span style="color: #ff0000;">&quot;20&quot;</span></span>
<span style="color: #000000;">            top=<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:text</span><span style="color: #7400FF;">&gt;</span><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 style="color: #7400FF;">&lt;/s:text</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:RichText</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>lineHeight</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/03/18/setting-the-line-height-on-a-spark-richtext-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_RichText_lineHeight_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>
&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|RichText {
            lineHeight: 24;
        }
    <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:RichText</span> id=<span style="color: #ff0000;">&quot;richTxt&quot;</span></span>
<span style="color: #000000;">            textAlign=<span style="color: #ff0000;">&quot;justify&quot;</span></span>
<span style="color: #000000;">            left=<span style="color: #ff0000;">&quot;20&quot;</span> right=<span style="color: #ff0000;">&quot;20&quot;</span></span>
<span style="color: #000000;">            top=<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:text</span><span style="color: #7400FF;">&gt;</span><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 style="color: #7400FF;">&lt;/s:text</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:RichText</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>lineHeight</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/03/18/setting-the-line-height-on-a-spark-richtext-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_RichText_lineHeight_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;lineHeight:&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;10&quot;</span> maximum=<span style="color: #ff0000;">&quot;24&quot;</span></span>
<span style="color: #000000;">                        value=<span style="color: #ff0000;">&quot;14&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;/mx:FormItem</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:Form</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:controlBarContent</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;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;">                richTxt.setStyle<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;lineHeight&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:RichText</span> id=<span style="color: #ff0000;">&quot;richTxt&quot;</span></span>
<span style="color: #000000;">            textAlign=<span style="color: #ff0000;">&quot;justify&quot;</span></span>
<span style="color: #000000;">            left=<span style="color: #ff0000;">&quot;20&quot;</span> right=<span style="color: #ff0000;">&quot;20&quot;</span></span>
<span style="color: #000000;">            top=<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:text</span><span style="color: #7400FF;">&gt;</span><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 style="color: #7400FF;">&lt;/s:text</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:RichText</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>lineHeight</code> style to a percentage value, as seen in the following snippets.<br />
<strong>MXML:</strong></p>

<div class="wp_syntax"><div class="code"><pre class="mxml" style="font-family:monospace;"><span style="color: #000000;"><span style="color: #7400FF;">&lt;s:RichText</span> id=<span style="color: #ff0000;">&quot;richTxt&quot;</span></span>
<span style="color: #000000;">        lineHeight=<span style="color: #ff0000;">&quot;200%&quot;</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:text</span><span style="color: #7400FF;">&gt;</span><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 style="color: #7400FF;">&lt;/s:text</span><span style="color: #7400FF;">&gt;</span></span>
<span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:RichText</span><span style="color: #7400FF;">&gt;</span></span></pre></div></div>

<p><strong>CSS:</strong></p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">&lt;fx<span style="color: #3333ff;">:Style</span><span style="color: #00AA00;">&gt;</span>
    <span style="color: #a1a100;">@namespace s &quot;library://ns.adobe.com/flex/spark&quot;;</span>
&nbsp;
    s|RichText <span style="color: #00AA00;">&#123;</span>
        lineHeight<span style="color: #00AA00;">:</span> <span style="color: #ff0000;">&quot;200%&quot;</span><span style="color: #00AA00;">;</span>
    <span style="color: #00AA00;">&#125;</span>
&lt;/fx<span style="color: #3333ff;">:Style</span><span style="color: #00AA00;">&gt;</span></pre></div></div>

<p><strong>ActionScript:</strong></p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #000066; font-weight: bold;">&lt;</span>fx<span style="color: #000066; font-weight: bold;">:</span>Script<span style="color: #000066; font-weight: bold;">&gt;</span>
    <span style="color: #000066; font-weight: bold;">&lt;!</span><span style="color: #000000;">&#91;</span>CDATA<span style="color: #000000;">&#91;</span>
        <span style="color: #0033ff; font-weight: bold;">protected</span> <span style="color: #339966; font-weight: bold;">function</span> hslider1_changeHandler<span style="color: #000000;">&#40;</span>evt<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">Event</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span> <span style="color: #000000;">&#123;</span>
            richTxt<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">setStyle</span><span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;lineHeight&quot;</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #990000;">&quot;200%&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
        <span style="color: #000000;">&#125;</span>
    <span style="color: #000000;">&#93;</span><span style="color: #000000;">&#93;</span><span style="color: #000066; font-weight: bold;">&gt;</span>
<span style="color: #000066; font-weight: bold;">&lt;/</span>fx<span style="color: #000066; font-weight: bold;">:</span>Script<span style="color: #000066; font-weight: bold;">&gt;</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 line height on a Spark RichText control in Flex 4 on FlexExamples.com',url: 'http://blog.flexexamples.com/2010/03/18/setting-the-line-height-on-a-spark-richtext-control-in-flex-4/',contentID: 'post-2605',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'Gumbo,lineHeight',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/03/18/setting-the-line-height-on-a-spark-richtext-control-in-flex-4/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Creating a justified multiline Spark Button control in Flex 4</title>
		<link>http://blog.flexexamples.com/2010/03/09/creating-a-justified-multiline-spark-button-control-in-flex-4/</link>
		<comments>http://blog.flexexamples.com/2010/03/09/creating-a-justified-multiline-spark-button-control-in-flex-4/#comments</comments>
		<pubDate>Wed, 10 Mar 2010 01:07:48 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[beta2]]></category>
		<category><![CDATA[Button (Spark)]]></category>
		<category><![CDATA[Gumbo]]></category>
		<category><![CDATA[skinClass]]></category>
		<category><![CDATA[textAlign]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/?p=2586</guid>
		<description><![CDATA[<p>The following example shows how you can create a multiline, justified label on Spark Button control in Flex 4 by creating a custom skin and setting the textAlign style and removing the maxDisplayedLines property.</p> <p></p> &#60;?xml version=&#34;1.0&#34; encoding=&#34;utf-8&#34;?&#62; &#60;!-- http://blog.flexexamples.com/2010/03/09/creating-a-justified-multiline-spark-button-control-in-flex-4/ --&#62; &#60;s:Application name=&#34;Spark_Button_skinClass_textAlign_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; &#160; &#60;s:Button id=&#34;btn&#34; label=&#34;Lorem ipsum dolor sit amet, consectetur [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can create a multiline, justified label on Spark Button control in Flex 4 by creating a custom skin and setting the <code>textAlign</code> style and removing the <code>maxDisplayedLines</code> property.</p>
<p><span id="more-2586"></span></p>
<p class="alert">The following example(s) require Flash Player 10 and the Adobe Flex 4 SDK. To download the Adobe Flash Builder 4 trial, see <a href="http://bit.ly/crThlI">http://www.adobe.com/products/flex/</a>. To download the latest nightly build of the Flex 4 SDK, see <a href="http://bit.ly/Flex4SDK">http://opensource.adobe.com/wiki/display/flexsdk/Download+Flex+4</a>.<br/><strong>For more information on getting started with Flex 4 and Flash Builder 4, see the official <a href="http://bit.ly/dCkecm">Adobe Flex Team blog</a>.</strong></p>

<div class="wp_syntax"><div class="code"><pre class="mxml" style="font-family:monospace;"><span style="color: #000000;">&lt;?xml version=<span style="color: #ff0000;">&quot;1.0&quot;</span> encoding=<span style="color: #ff0000;">&quot;utf-8&quot;</span>?<span style="color: #7400FF;">&gt;</span></span>
<span style="color: #000000;"><span style="color: #808080; font-style: italic;">&lt;!-- http://blog.flexexamples.com/2010/03/09/creating-a-justified-multiline-spark-button-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_Button_skinClass_textAlign_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>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Button</span> id=<span style="color: #ff0000;">&quot;btn&quot;</span></span>
<span style="color: #000000;">            label=<span style="color: #ff0000;">&quot;Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent sed nisi libero, id semper leo. Vivamus tempus massa nec sapien vehicula pharetra. Nullam ipsum tellus, tempus placerat euismod ut, pharetra eu velit. Suspendisse iaculis placerat metus, a facilisis libero ultricies id. Pellentesque eget lorem a diam tempus fringilla vitae fermentum purus.{'\n'}Vivamus condimentum euismod est, sit amet fermentum justo pretium quis. Donec pretium commodo augue varius imperdiet. Morbi facilisis mollis est, id cursus turpis sagittis a. Fusce nec dolor quis mi interdum congue a sit amet elit. Quisque auctor ornare imperdiet. Suspendisse velit purus, tincidunt at pellentesque vitae, malesuada sit amet ligula. Integer varius justo sit amet augue accumsan non tempor purus gravida.&quot;</span></span>
<span style="color: #000000;">            skinClass=<span style="color: #ff0000;">&quot;skins.WrapButtonSkin&quot;</span></span>
<span style="color: #000000;">            width=<span style="color: #ff0000;">&quot;400&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 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>

<div span="googleAdsLeaderboard">
<script type="text/javascript"><!--
google_ad_client = "pub-3325829455487492";
/* 728x90, created 7/15/09 */
google_ad_slot = "6403511741";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
<br />
</div>
<p class="information"><a href="http://dl.dropbox.com/u/4509565/FlexExamples_com/Spark_Button_skinClass_textAlign_test/srcview/index.html">View source</a> is enabled in the following example.</p>
<p><iframe src="http://dl.dropbox.com/u/4509565/FlexExamples_com/Spark_Button_skinClass_textAlign_test/main.html" width="100%" height="300"></iframe></p>
<p>And the custom Spark Button skin, <em>skins/WrapButtonSkin.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/03/09/creating-a-justified-multiline-spark-button-control-in-flex-4/ --&gt;</span></span>
<span style="color: #000000;"><span style="color: #7400FF;">&lt;s:SparkSkin</span> name=<span style="color: #ff0000;">&quot;WrapButtonSkin&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;">        minWidth=<span style="color: #ff0000;">&quot;21&quot;</span> minHeight=<span style="color: #ff0000;">&quot;21&quot;</span></span>
<span style="color: #000000;">        alpha.disabled=<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;up&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;over&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;down&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:states</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #808080; font-style: italic;">&lt;!-- host component --&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Metadata</span><span style="color: #7400FF;">&gt;</span></span>
        [HostComponent(&quot;spark.components.Button&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 button, the graphics are colorized but the label is not. */</span>
<span style="color: #000000;">            static private const exclusions:Array = <span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">&quot;labelDisplay&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;
&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;">                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>
&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>
<span style="color: #000000;">                    shadow.radiusX = cornerRadius;</span>
<span style="color: #000000;">                    fill.radiusX = cornerRadius;</span>
<span style="color: #000000;">                    lowlight.radiusX = cornerRadius;</span>
<span style="color: #000000;">                    highlight.radiusX = cornerRadius;</span>
<span style="color: #000000;">                    border.radiusX = cornerRadius;</span>
<span style="color: #000000;">                <span style="color: #66cc66;">&#125;</span></span>
&nbsp;
<span style="color: #000000;">                if <span style="color: #66cc66;">&#40;</span>highlightStroke<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">                    highlightStroke.radiusX = cornerRadius;</span>
<span style="color: #000000;">                <span style="color: #66cc66;">&#125;</span></span>
<span style="color: #000000;">                if <span style="color: #66cc66;">&#40;</span>hldownstroke1<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">                    hldownstroke1.radiusX = cornerRadius;</span>
<span style="color: #000000;">                <span style="color: #66cc66;">&#125;</span></span>
<span style="color: #000000;">                if <span style="color: #66cc66;">&#40;</span>hldownstroke2<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">                    hldownstroke2.radiusX = cornerRadius;</span>
<span style="color: #000000;">                <span style="color: #66cc66;">&#125;</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 var cornerRadius:Number = <span style="color: #cc66cc;">2</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: #808080; font-style: italic;">&lt;!-- layer 1: shadow --&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Rect</span> id=<span style="color: #ff0000;">&quot;shadow&quot;</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;-1&quot;</span> bottom=<span style="color: #ff0000;">&quot;-1&quot;</span> radiusX=<span style="color: #ff0000;">&quot;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;0x000000&quot;</span> color.down=<span style="color: #ff0000;">&quot;0xFFFFFF&quot;</span> alpha=<span style="color: #ff0000;">&quot;0.01&quot;</span> alpha.down=<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:GradientEntry</span> color=<span style="color: #ff0000;">&quot;0x000000&quot;</span> color.down=<span style="color: #ff0000;">&quot;0xFFFFFF&quot;</span> alpha=<span style="color: #ff0000;">&quot;0.07&quot;</span> alpha.down=<span style="color: #ff0000;">&quot;0.5&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 2: fill --&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Rect</span> id=<span style="color: #ff0000;">&quot;fill&quot;</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;1&quot;</span> bottom=<span style="color: #ff0000;">&quot;1&quot;</span> radiusX=<span style="color: #ff0000;">&quot;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;0xFFFFFF&quot;</span> color.over=<span style="color: #ff0000;">&quot;0xBBBDBD&quot;</span> color.down=<span style="color: #ff0000;">&quot;0xAAAAAA&quot;</span> alpha=<span style="color: #ff0000;">&quot;0.85&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> color.over=<span style="color: #ff0000;">&quot;0x9FA0A1&quot;</span> color.down=<span style="color: #ff0000;">&quot;0x929496&quot;</span> alpha=<span style="color: #ff0000;">&quot;0.85&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 3: fill lowlight --&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Rect</span> id=<span style="color: #ff0000;">&quot;lowlight&quot;</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;1&quot;</span> bottom=<span style="color: #ff0000;">&quot;1&quot;</span> radiusX=<span style="color: #ff0000;">&quot;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;270&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;0x000000&quot;</span> ratio=<span style="color: #ff0000;">&quot;0.0&quot;</span> alpha=<span style="color: #ff0000;">&quot;0.0627&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;0x000000&quot;</span> ratio=<span style="color: #ff0000;">&quot;0.48&quot;</span> alpha=<span style="color: #ff0000;">&quot;0.0099&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;0x000000&quot;</span> ratio=<span style="color: #ff0000;">&quot;0.48001&quot;</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: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 4: fill highlight --&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Rect</span> id=<span style="color: #ff0000;">&quot;highlight&quot;</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;1&quot;</span> bottom=<span style="color: #ff0000;">&quot;1&quot;</span> radiusX=<span style="color: #ff0000;">&quot;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;0xFFFFFF&quot;</span> ratio=<span style="color: #ff0000;">&quot;0.0&quot;</span> alpha=<span style="color: #ff0000;">&quot;0.33&quot;</span> alpha.over=<span style="color: #ff0000;">&quot;0.22&quot;</span> alpha.down=<span style="color: #ff0000;">&quot;0.12&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;0xFFFFFF&quot;</span> ratio=<span style="color: #ff0000;">&quot;0.48&quot;</span> alpha=<span style="color: #ff0000;">&quot;0.33&quot;</span> alpha.over=<span style="color: #ff0000;">&quot;0.22&quot;</span> alpha.down=<span style="color: #ff0000;">&quot;0.12&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;0xFFFFFF&quot;</span> ratio=<span style="color: #ff0000;">&quot;0.48001&quot;</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: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 5: highlight stroke (all states except down) --&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Rect</span> id=<span style="color: #ff0000;">&quot;highlightStroke&quot;</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;1&quot;</span> bottom=<span style="color: #ff0000;">&quot;1&quot;</span> radiusX=<span style="color: #ff0000;">&quot;2&quot;</span> excludeFrom=<span style="color: #ff0000;">&quot;down&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;0xFFFFFF&quot;</span> alpha.over=<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:GradientEntry</span> color=<span style="color: #ff0000;">&quot;0xD8D8D8&quot;</span> alpha.over=<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: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 6: highlight stroke (down state only) --&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Rect</span> id=<span style="color: #ff0000;">&quot;hldownstroke1&quot;</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;1&quot;</span> bottom=<span style="color: #ff0000;">&quot;1&quot;</span> radiusX=<span style="color: #ff0000;">&quot;2&quot;</span> includeIn=<span style="color: #ff0000;">&quot;down&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;0x000000&quot;</span> alpha=<span style="color: #ff0000;">&quot;0.25&quot;</span> ratio=<span style="color: #ff0000;">&quot;0.0&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;0x000000&quot;</span> alpha=<span style="color: #ff0000;">&quot;0.25&quot;</span> ratio=<span style="color: #ff0000;">&quot;0.001&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;0x000000&quot;</span> alpha=<span style="color: #ff0000;">&quot;0.07&quot;</span> ratio=<span style="color: #ff0000;">&quot;0.0011&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;0x000000&quot;</span> alpha=<span style="color: #ff0000;">&quot;0.07&quot;</span> ratio=<span style="color: #ff0000;">&quot;0.965&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;0x000000&quot;</span> alpha=<span style="color: #ff0000;">&quot;0.00&quot;</span> ratio=<span style="color: #ff0000;">&quot;0.9651&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: #7400FF;">&lt;s:Rect</span> id=<span style="color: #ff0000;">&quot;hldownstroke2&quot;</span> left=<span style="color: #ff0000;">&quot;2&quot;</span> right=<span style="color: #ff0000;">&quot;2&quot;</span> top=<span style="color: #ff0000;">&quot;2&quot;</span> bottom=<span style="color: #ff0000;">&quot;2&quot;</span> radiusX=<span style="color: #ff0000;">&quot;2&quot;</span> includeIn=<span style="color: #ff0000;">&quot;down&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;0x000000&quot;</span> alpha=<span style="color: #ff0000;">&quot;0.09&quot;</span> ratio=<span style="color: #ff0000;">&quot;0.0&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;0x000000&quot;</span> alpha=<span style="color: #ff0000;">&quot;0.00&quot;</span> ratio=<span style="color: #ff0000;">&quot;0.0001&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 7: border - put on top of the fill so it doesn't disappear when scale is less than 1 --&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Rect</span> id=<span style="color: #ff0000;">&quot;border&quot;</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> width=<span style="color: #ff0000;">&quot;69&quot;</span> height=<span style="color: #ff0000;">&quot;20&quot;</span> radiusX=<span style="color: #ff0000;">&quot;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;0x000000&quot;</span> alpha=<span style="color: #ff0000;">&quot;0.5625&quot;</span> alpha.down=<span style="color: #ff0000;">&quot;0.6375&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;0x000000&quot;</span> alpha=<span style="color: #ff0000;">&quot;0.75&quot;</span> alpha.down=<span style="color: #ff0000;">&quot;0.85&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 8: text --&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Label</span> id=<span style="color: #ff0000;">&quot;labelDisplay&quot;</span></span>
<span style="color: #000000;">            textAlign=<span style="color: #ff0000;">&quot;justify&quot;</span></span>
<span style="color: #000000;">            verticalAlign=<span style="color: #ff0000;">&quot;middle&quot;</span></span>
<span style="color: #000000;">            horizontalCenter=<span style="color: #ff0000;">&quot;0&quot;</span> verticalCenter=<span style="color: #ff0000;">&quot;1&quot;</span></span>
<span style="color: #000000;">            left=<span style="color: #ff0000;">&quot;10&quot;</span> right=<span style="color: #ff0000;">&quot;10&quot;</span> top=<span style="color: #ff0000;">&quot;10&quot;</span> bottom=<span style="color: #ff0000;">&quot;10&quot;</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: 'Creating a justified multiline Spark Button control in Flex 4 on FlexExamples.com',url: 'http://blog.flexexamples.com/2010/03/09/creating-a-justified-multiline-spark-button-control-in-flex-4/',contentID: 'post-2586',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'Gumbo,skinClass,textAlign',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/03/09/creating-a-justified-multiline-spark-button-control-in-flex-4/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Creating a drop down DataGrid control in Flex 4</title>
		<link>http://blog.flexexamples.com/2010/03/09/creating-a-drop-down-datagrid-control-in-flex-4/</link>
		<comments>http://blog.flexexamples.com/2010/03/09/creating-a-drop-down-datagrid-control-in-flex-4/#comments</comments>
		<pubDate>Tue, 09 Mar 2010 18:36:43 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[beta2]]></category>
		<category><![CDATA[DataGrid]]></category>
		<category><![CDATA[PopUpAnchor (Spark)]]></category>
		<category><![CDATA[displayPopUp]]></category>
		<category><![CDATA[Gumbo]]></category>
		<category><![CDATA[popUpPosition]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/?p=2582</guid>
		<description><![CDATA[<p>The following example shows how you can create a drop down MX DataGrid control in Flex 4 using the Spark PopUpAnchor control in Flex 4.</p> <p></p> &#60;?xml version=&#34;1.0&#34; encoding=&#34;utf-8&#34;?&#62; &#60;!-- http://blog.flexexamples.com/2010/03/09/creating-a-drop-down-datagrid-control-in-flex-4/ --&#62; &#60;s:Application name=&#34;Spark_PopUpAnchor_DataGrid_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; paddingTop=&#34;20&#34; /&#62; &#60;/s:layout&#62; &#160; &#60;s:Group&#62; &#60;s:Button label=&#34;Pop up DataGrid&#34; click=&#34;popUpAnc.displayPopUp = !popUpAnc.displayPopUp;&#34; /&#62; &#60;s:PopUpAnchor id=&#34;popUpAnc&#34; [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can create a drop down MX DataGrid control in Flex 4 using the Spark PopUpAnchor control in Flex 4.</p>
<p><span id="more-2582"></span></p>
<p class="alert">The following example(s) require Flash Player 10 and the Adobe Flex 4 SDK. To download the Adobe Flash Builder 4 trial, see <a href="http://bit.ly/crThlI">http://www.adobe.com/products/flex/</a>. To download the latest nightly build of the Flex 4 SDK, see <a href="http://bit.ly/Flex4SDK">http://opensource.adobe.com/wiki/display/flexsdk/Download+Flex+4</a>.<br/><strong>For more information on getting started with Flex 4 and Flash Builder 4, see the official <a href="http://bit.ly/dCkecm">Adobe Flex Team blog</a>.</strong></p>

<div class="wp_syntax"><div class="code"><pre class="mxml" style="font-family:monospace;"><span style="color: #000000;">&lt;?xml version=<span style="color: #ff0000;">&quot;1.0&quot;</span> encoding=<span style="color: #ff0000;">&quot;utf-8&quot;</span>?<span style="color: #7400FF;">&gt;</span></span>
<span style="color: #000000;"><span style="color: #808080; font-style: italic;">&lt;!-- http://blog.flexexamples.com/2010/03/09/creating-a-drop-down-datagrid-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_PopUpAnchor_DataGrid_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> paddingTop=<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:layout</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <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:Button</span> label=<span style="color: #ff0000;">&quot;Pop up DataGrid&quot;</span></span>
<span style="color: #000000;">                click=<span style="color: #ff0000;">&quot;popUpAnc.displayPopUp = !popUpAnc.displayPopUp;&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:PopUpAnchor</span> id=<span style="color: #ff0000;">&quot;popUpAnc&quot;</span></span>
<span style="color: #000000;">                popUpPosition=<span style="color: #ff0000;">&quot;below&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 style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:DataGrid</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:dataProvider</span><span style="color: #7400FF;">&gt;</span></span>
                    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:ArrayList</span><span style="color: #7400FF;">&gt;</span></span>
                        <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> c1=<span style="color: #ff0000;">&quot;Row 1, Column 1&quot;</span> c2=<span style="color: #ff0000;">&quot;Row 1, Column 2&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                        <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> c1=<span style="color: #ff0000;">&quot;Row 2, Column 1&quot;</span> c2=<span style="color: #ff0000;">&quot;Row 2, Column 2&quot;</span> <span style="color: #7400FF;">/&gt;</span></span> 
                        <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> c1=<span style="color: #ff0000;">&quot;Row 3, Column 1&quot;</span> c2=<span style="color: #ff0000;">&quot;Row 3, Column 2&quot;</span> <span style="color: #7400FF;">/&gt;</span></span> 
                        <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> c1=<span style="color: #ff0000;">&quot;Row 4, Column 1&quot;</span> c2=<span style="color: #ff0000;">&quot;Row 4, Column 2&quot;</span> <span style="color: #7400FF;">/&gt;</span></span> 
                        <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> c1=<span style="color: #ff0000;">&quot;Row 5, Column 1&quot;</span> c2=<span style="color: #ff0000;">&quot;Row 5, Column 2&quot;</span> <span style="color: #7400FF;">/&gt;</span></span> 
                        <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> c1=<span style="color: #ff0000;">&quot;Row 6, Column 1&quot;</span> c2=<span style="color: #ff0000;">&quot;Row 6, Column 2&quot;</span> <span style="color: #7400FF;">/&gt;</span></span> 
                        <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> c1=<span style="color: #ff0000;">&quot;Row 7, Column 1&quot;</span> c2=<span style="color: #ff0000;">&quot;Row 7, Column 2&quot;</span> <span style="color: #7400FF;">/&gt;</span></span> 
                        <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> c1=<span style="color: #ff0000;">&quot;Row 8, Column 1&quot;</span> c2=<span style="color: #ff0000;">&quot;Row 8, Column 2&quot;</span> <span style="color: #7400FF;">/&gt;</span></span> 
                        <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> c1=<span style="color: #ff0000;">&quot;Row 9, Column 1&quot;</span> c2=<span style="color: #ff0000;">&quot;Row 9, Column 2&quot;</span> <span style="color: #7400FF;">/&gt;</span></span> 
                    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:ArrayList</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:dataProvider</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:DataGrid</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:PopUpAnchor</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:Application</span><span style="color: #7400FF;">&gt;</span></span></pre></div></div>

<div span="googleAdsLeaderboard">
<script type="text/javascript"><!--
google_ad_client = "pub-3325829455487492";
/* 728x90, created 7/15/09 */
google_ad_slot = "6403511741";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
<br />
</div>
<p class="information"><a href="http://dl.dropbox.com/u/4509565/FlexExamples_com/Spark_PopUpAnchor_DataGrid_test/srcview/index.html">View source</a> is enabled in the following example.</p>
<p><iframe src="http://dl.dropbox.com/u/4509565/FlexExamples_com/Spark_PopUpAnchor_DataGrid_test/main.html" width="100%" height="300"></iframe></p>
<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: 'Creating a drop down DataGrid control in Flex 4 on FlexExamples.com',url: 'http://blog.flexexamples.com/2010/03/09/creating-a-drop-down-datagrid-control-in-flex-4/',contentID: 'post-2582',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'displayPopUp,Gumbo,popUpPosition',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/03/09/creating-a-drop-down-datagrid-control-in-flex-4/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Setting the slide duration on a Spark HScrollBar control in Flex 4</title>
		<link>http://blog.flexexamples.com/2010/02/28/setting-the-slide-duration-on-a-spark-hscrollbar-control-in-flex-4/</link>
		<comments>http://blog.flexexamples.com/2010/02/28/setting-the-slide-duration-on-a-spark-hscrollbar-control-in-flex-4/#comments</comments>
		<pubDate>Mon, 01 Mar 2010 06:33:37 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[beta2]]></category>
		<category><![CDATA[HScrollBar (Spark)]]></category>
		<category><![CDATA[List (Spark)]]></category>
		<category><![CDATA[Scroller (Spark)]]></category>
		<category><![CDATA[VScrollBar (Spark)]]></category>
		<category><![CDATA[Gumbo]]></category>
		<category><![CDATA[slideDuration]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/?p=2545</guid>
		<description><![CDATA[<p>In a previous example, <a href="http://blog.flexexamples.com/2009/05/28/setting-the-slide-duration-on-a-spark-hslider-control-in-flex-gumbo/">&#8220;Setting the slide duration on a Spark HSlider control in Flex 4&#8243;</a>, we saw how you could set the slide duration on a Spark HSlider control in Flex 4 by setting the slideDuration style.</p> <p>The following example shows how you can set the slide duration on a Spark HScrollBar control [...]]]></description>
			<content:encoded><![CDATA[<p>In a previous example, <a href="http://blog.flexexamples.com/2009/05/28/setting-the-slide-duration-on-a-spark-hslider-control-in-flex-gumbo/">&#8220;Setting the slide duration on a Spark HSlider control in Flex 4&#8243;</a>, we saw how you could set the slide duration on a Spark HSlider control in Flex 4 by setting the <code>slideDuration</code> style.</p>
<p>The following example shows how you can set the slide duration on a Spark HScrollBar control in Flex 4 by setting the <code>slideDuration</code> style to control the animated thumb scroll when Ctrl+clicking on the scroll bar track.</p>
<p><span id="more-2545"></span></p>
<p class="alert">The following example(s) require Flash Player 10 and the Adobe Flex 4 SDK. To download the Adobe Flash Builder 4 trial, see <a href="http://bit.ly/crThlI">http://www.adobe.com/products/flex/</a>. To download the latest nightly build of the Flex 4 SDK, see <a href="http://bit.ly/Flex4SDK">http://opensource.adobe.com/wiki/display/flexsdk/Download+Flex+4</a>.<br/><strong>For more information on getting started with Flex 4 and Flash Builder 4, see the official <a href="http://bit.ly/dCkecm">Adobe Flex Team blog</a>.</strong></p>

<div class="wp_syntax"><div class="code"><pre class="mxml" style="font-family:monospace;"><span style="color: #000000;">&lt;?xml version=<span style="color: #ff0000;">&quot;1.0&quot;</span> encoding=<span style="color: #ff0000;">&quot;utf-8&quot;</span>?<span style="color: #7400FF;">&gt;</span></span>
<span style="color: #000000;"><span style="color: #808080; font-style: italic;">&lt;!-- http://blog.flexexamples.com/2010/02/28/setting-the-slide-duration-on-a-spark-hscrollbar-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_HScrollBar_slideDuration_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>
<span style="color: #000000;">        initialize=<span style="color: #ff0000;">&quot;init();&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 s &quot;library://ns.adobe.com/flex/spark&quot;;
        @namespace mx &quot;library://ns.adobe.com/flex/mx&quot;;
&nbsp;
        s|ScrollBarBase {
            slideDuration: 8000; /* ms */
        }
    <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;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.collections.ArrayList;</span>
&nbsp;
<span style="color: #000000;">            <span style="color: #66cc66;">&#91;</span>Bindable<span style="color: #66cc66;">&#93;</span></span>
<span style="color: #000000;">            private var dp:ArrayList;</span>
&nbsp;
<span style="color: #000000;">            private function init<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:void <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">                var arr:Array = new Array<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                var idx:uint = <span style="color: #cc66cc;">0</span>;</span>
<span style="color: #000000;">                const LEN:uint = <span style="color: #cc66cc;">1000</span>;</span>
&nbsp;
<span style="color: #000000;">                for <span style="color: #66cc66;">&#40;</span>idx = <span style="color: #cc66cc;">0</span>; idx &lt; LEN; idx++<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">                    arr.push<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#123;</span>label:<span style="color: #ff0000;">&quot;item &quot;</span> + idx.toString<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                <span style="color: #66cc66;">&#125;</span></span>
<span style="color: #000000;">                dp = new ArrayList<span style="color: #66cc66;">&#40;</span>arr<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:List</span> id=<span style="color: #ff0000;">&quot;lst&quot;</span></span>
<span style="color: #000000;">            dataProvider=<span style="color: #ff0000;">&quot;{dp}&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 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> requestedRowCount=<span style="color: #ff0000;">&quot;10&quot;</span> horizontalAlign=<span style="color: #ff0000;">&quot;contentJustify&quot;</span> gap=<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:List</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>

<div span="googleAdsLeaderboard">
<script type="text/javascript"><!--
google_ad_client = "pub-3325829455487492";
/* 728x90, created 7/15/09 */
google_ad_slot = "6403511741";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
<br />
</div>
<p class="information"><a href="http://dl.dropbox.com/u/4509565/FlexExamples_com/Spark_HScrollBar_slideDuration_test/srcview/index.html">View source</a> is enabled in the following example.</p>
<p><iframe src="http://dl.dropbox.com/u/4509565/FlexExamples_com/Spark_HScrollBar_slideDuration_test/main.html" width="100%" height="400"></iframe></p>
<p>You can also set the <code>slideDuration</code> style on a VScrollBar instance (in this case via the List control&#8217;s <code>slider</code> skin part) 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/02/28/setting-the-slide-duration-on-a-spark-hscrollbar-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_HScrollBar_slideDuration_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>
<span style="color: #000000;">        initialize=<span style="color: #ff0000;">&quot;init();&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.collections.ArrayList;</span>
<span style="color: #000000;">            import mx.events.FlexEvent;</span>
&nbsp;
<span style="color: #000000;">            <span style="color: #66cc66;">&#91;</span>Bindable<span style="color: #66cc66;">&#93;</span></span>
<span style="color: #000000;">            private var dp:ArrayList;</span>
&nbsp;
<span style="color: #000000;">            private function init<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:void <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">                var arr:Array = new Array<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                var idx:uint = <span style="color: #cc66cc;">0</span>;</span>
<span style="color: #000000;">                const LEN:uint = <span style="color: #cc66cc;">1000</span>;</span>
&nbsp;
<span style="color: #000000;">                for <span style="color: #66cc66;">&#40;</span>idx = <span style="color: #cc66cc;">0</span>; idx &lt; LEN; idx++<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">                    arr.push<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#123;</span>label:<span style="color: #ff0000;">&quot;item &quot;</span> + idx.toString<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                <span style="color: #66cc66;">&#125;</span></span>
<span style="color: #000000;">                dp = new ArrayList<span style="color: #66cc66;">&#40;</span>arr<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 lst_creationCompleteHandler<span style="color: #66cc66;">&#40;</span>evt:FlexEvent<span style="color: #66cc66;">&#41;</span>:void <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">                lst.scroller.verticalScrollBar.setStyle<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;slideDuration&quot;</span>, <span style="color: #cc66cc;">8000</span> /* ms */<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:List</span> id=<span style="color: #ff0000;">&quot;lst&quot;</span></span>
<span style="color: #000000;">            dataProvider=<span style="color: #ff0000;">&quot;{dp}&quot;</span></span>
<span style="color: #000000;">            horizontalCenter=<span style="color: #ff0000;">&quot;0&quot;</span> verticalCenter=<span style="color: #ff0000;">&quot;0&quot;</span></span>
<span style="color: #000000;">            creationComplete=<span style="color: #ff0000;">&quot;lst_creationCompleteHandler(event);&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> requestedRowCount=<span style="color: #ff0000;">&quot;10&quot;</span> horizontalAlign=<span style="color: #ff0000;">&quot;contentJustify&quot;</span> gap=<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:List</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 globally set the <code>slideDuration</code> style via the StyleManager in 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/02/28/setting-the-slide-duration-on-a-spark-hscrollbar-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_HScrollBar_slideDuration_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>
<span style="color: #000000;">        creationComplete=<span style="color: #ff0000;">&quot;init();&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.collections.ArrayList;</span>
<span style="color: #000000;">            import mx.events.FlexEvent;</span>
&nbsp;
<span style="color: #000000;">            <span style="color: #66cc66;">&#91;</span>Bindable<span style="color: #66cc66;">&#93;</span></span>
<span style="color: #000000;">            private var dp:ArrayList;</span>
&nbsp;
<span style="color: #000000;">            private function init<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:void <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">                var arr:Array = new Array<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                var idx:uint = <span style="color: #cc66cc;">0</span>;</span>
<span style="color: #000000;">                const LEN:uint = <span style="color: #cc66cc;">1000</span>;</span>
&nbsp;
<span style="color: #000000;">                for <span style="color: #66cc66;">&#40;</span>idx = <span style="color: #cc66cc;">0</span>; idx &lt; LEN; idx++<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">                    arr.push<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#123;</span>label:<span style="color: #ff0000;">&quot;item &quot;</span> + idx.toString<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                <span style="color: #66cc66;">&#125;</span></span>
<span style="color: #000000;">                dp = new ArrayList<span style="color: #66cc66;">&#40;</span>arr<span style="color: #66cc66;">&#41;</span>;</span>
&nbsp;
<span style="color: #000000;">                var sbbCSS:CSSStyleDeclaration = styleManager.getStyleDeclaration<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;spark.components.supportClasses.ScrollBarBase&quot;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                if <span style="color: #66cc66;">&#40;</span>!sbbCSS<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">                    sbbCSS = new CSSStyleDeclaration<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;spark.components.supportClasses.ScrollBarBase&quot;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                <span style="color: #66cc66;">&#125;</span></span>
<span style="color: #000000;">                sbbCSS.setStyle<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;slideDuration&quot;</span>, <span style="color: #cc66cc;">8000</span> /* ms */<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:List</span> id=<span style="color: #ff0000;">&quot;lst&quot;</span></span>
<span style="color: #000000;">            dataProvider=<span style="color: #ff0000;">&quot;{dp}&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 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> requestedRowCount=<span style="color: #ff0000;">&quot;10&quot;</span> horizontalAlign=<span style="color: #ff0000;">&quot;contentJustify&quot;</span> gap=<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:List</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 slide duration on a Spark HScrollBar control in Flex 4 on FlexExamples.com',url: 'http://blog.flexexamples.com/2010/02/28/setting-the-slide-duration-on-a-spark-hscrollbar-control-in-flex-4/',contentID: 'post-2545',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'Gumbo,slideDuration',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/02/28/setting-the-slide-duration-on-a-spark-hscrollbar-control-in-flex-4/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Preventing the selected item highlighting in the Spark List control in Flex 4</title>
		<link>http://blog.flexexamples.com/2010/02/25/preventing-the-selected-item-highlighting-in-the-spark-list-control-in-flex-4/</link>
		<comments>http://blog.flexexamples.com/2010/02/25/preventing-the-selected-item-highlighting-in-the-spark-list-control-in-flex-4/#comments</comments>
		<pubDate>Thu, 25 Feb 2010 19:50:03 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[beta2]]></category>
		<category><![CDATA[List (Spark)]]></category>
		<category><![CDATA[autoDrawBackground]]></category>
		<category><![CDATA[Gumbo]]></category>
		<category><![CDATA[itemRenderer]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/?p=2526</guid>
		<description><![CDATA[<p>In a previous example, <a href="http://blog.flexexamples.com/2010/02/25/preventing-item-selection-in-the-spark-list-control-in-flex-4/">&#8220;Preventing item selection in the Spark List control in Flex 4&#8243;</a>, we saw how you can prevent item selection in the Spark List control in Flex 4 by listening for the changing event and calling the preventDefault() method on the IndexChangeEvent event object instance.</p> <p>The following example shows how you [...]]]></description>
			<content:encoded><![CDATA[<p>In a previous example, <a href="http://blog.flexexamples.com/2010/02/25/preventing-item-selection-in-the-spark-list-control-in-flex-4/">&#8220;Preventing item selection in the Spark List control in Flex 4&#8243;</a>, we saw how you can prevent item selection in the Spark List control in Flex 4 by listening for the <code>changing</code> event and calling the <code>preventDefault()</code> method on the IndexChangeEvent event object instance.</p>
<p>The following example shows how you can keep List item selection but prevent the selected item highlighting (while maintaining the hover highlight) in the Spark List control in Flex 4 by creating a custom item renderer, setting the <code>autoDrawBackground</code> property to <em>false</em>, and drawing your own highlight in the hover state only.</p>
<p><span id="more-2526"></span></p>
<p class="alert">The following example(s) require Flash Player 10 and the Adobe Flex 4 SDK. To download the Adobe Flash Builder 4 trial, see <a href="http://bit.ly/crThlI">http://www.adobe.com/products/flex/</a>. To download the latest nightly build of the Flex 4 SDK, see <a href="http://bit.ly/Flex4SDK">http://opensource.adobe.com/wiki/display/flexsdk/Download+Flex+4</a>.<br/><strong>For more information on getting started with Flex 4 and Flash Builder 4, see the official <a href="http://bit.ly/dCkecm">Adobe Flex Team blog</a>.</strong></p>

<div class="wp_syntax"><div class="code"><pre class="mxml" style="font-family:monospace;"><span style="color: #000000;">&lt;?xml version=<span style="color: #ff0000;">&quot;1.0&quot;</span> encoding=<span style="color: #ff0000;">&quot;utf-8&quot;</span>?<span style="color: #7400FF;">&gt;</span></span>
<span style="color: #000000;"><span style="color: #808080; font-style: italic;">&lt;!-- http://blog.flexexamples.com/2010/02/25/preventing-the-selected-item-highlighting-in-the-spark-list-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_List_itemRenderer_nonSelectable_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;selectedIndex:&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;{lst.selectedIndex}&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:FormItem</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:Form</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:controlBarContent</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:List</span> id=<span style="color: #ff0000;">&quot;lst&quot;</span></span>
<span style="color: #000000;">            itemRenderer=<span style="color: #ff0000;">&quot;skins.NonSelectableItemRenderer&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 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;justify&quot;</span></span>
<span style="color: #000000;">                              gap=<span style="color: #ff0000;">&quot;0&quot;</span></span>
<span style="color: #000000;">                              requestedRowCount=<span style="color: #ff0000;">&quot;5&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:dataProvider</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:ArrayList</span> source=<span style="color: #ff0000;">&quot;[The,Quick,Brown,Fox,Jumps,Over,The,Lazy,Dog]&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:dataProvider</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:List</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 List item renderer, <em>skins/NonSelectableItemRenderer.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/02/25/preventing-the-selected-item-highlighting-in-the-spark-list-control-in-flex-4/ --&gt;</span></span>
<span style="color: #000000;"><span style="color: #7400FF;">&lt;s:ItemRenderer</span> name=<span style="color: #ff0000;">&quot;NonSelectableItemRenderer&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>
<span style="color: #000000;">        autoDrawBackground=<span style="color: #ff0000;">&quot;false&quot;</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <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;hovered&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;s:Rect</span> width=<span style="color: #ff0000;">&quot;100%&quot;</span> height=<span style="color: #ff0000;">&quot;100%&quot;</span> includeIn=<span style="color: #ff0000;">&quot;hovered&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;haloBlue&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:Label</span> text=<span style="color: #ff0000;">&quot;{data}&quot;</span> left=<span style="color: #ff0000;">&quot;5&quot;</span> right=<span style="color: #ff0000;">&quot;5&quot;</span> top=<span style="color: #ff0000;">&quot;5&quot;</span> bottom=<span style="color: #ff0000;">&quot;5&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
&nbsp;
<span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:ItemRenderer</span><span style="color: #7400FF;">&gt;</span></span></pre></div></div>

<div span="googleAdsLeaderboard">
<script type="text/javascript"><!--
google_ad_client = "pub-3325829455487492";
/* 728x90, created 7/15/09 */
google_ad_slot = "6403511741";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
<br />
</div>
<p class="information"><a href="http://dl.dropbox.com/u/4509565/FlexExamples_com/Spark_List_itemRenderer_nonSelectable_test/srcview/index.html">View source</a> is enabled in the following example.</p>
<p><iframe src="http://dl.dropbox.com/u/4509565/FlexExamples_com/Spark_List_itemRenderer_nonSelectable_test/main.html" width="100%" height="300"></iframe></p>
<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: 'Preventing the selected item highlighting in the Spark List control in Flex 4 on FlexExamples.com',url: 'http://blog.flexexamples.com/2010/02/25/preventing-the-selected-item-highlighting-in-the-spark-list-control-in-flex-4/',contentID: 'post-2526',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'autoDrawBackground,Gumbo,itemRenderer',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/02/25/preventing-the-selected-item-highlighting-in-the-spark-list-control-in-flex-4/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Preventing item selection in the Spark List control in Flex 4</title>
		<link>http://blog.flexexamples.com/2010/02/25/preventing-item-selection-in-the-spark-list-control-in-flex-4/</link>
		<comments>http://blog.flexexamples.com/2010/02/25/preventing-item-selection-in-the-spark-list-control-in-flex-4/#comments</comments>
		<pubDate>Thu, 25 Feb 2010 19:28:14 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[beta2]]></category>
		<category><![CDATA[List (Spark)]]></category>
		<category><![CDATA[changing]]></category>
		<category><![CDATA[Gumbo]]></category>
		<category><![CDATA[preventDefault()]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/?p=2523</guid>
		<description><![CDATA[<p>The following example shows how you can prevent item selection in the Spark List control in Flex 4 by listening for the changing event and calling the preventDefault() method on the IndexChangeEvent event object instance.</p> <p></p> &#60;?xml version=&#34;1.0&#34; encoding=&#34;utf-8&#34;?&#62; &#60;!-- http://blog.flexexamples.com/2010/02/25/preventing-item-selection-in-the-spark-list-control-in-flex-4/ --&#62; &#60;s:Application name=&#34;Spark_List_changing_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; &#160; &#60;fx:Script&#62; &#60;!&#91;CDATA&#91; import spark.events.IndexChangeEvent; &#160; protected function [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can prevent item selection in the Spark List control in Flex 4 by listening for the <code>changing</code> event and calling the <code>preventDefault()</code> method on the IndexChangeEvent event object instance.</p>
<p><span id="more-2523"></span></p>
<p class="alert">The following example(s) require Flash Player 10 and the Adobe Flex 4 SDK. To download the Adobe Flash Builder 4 trial, see <a href="http://bit.ly/crThlI">http://www.adobe.com/products/flex/</a>. To download the latest nightly build of the Flex 4 SDK, see <a href="http://bit.ly/Flex4SDK">http://opensource.adobe.com/wiki/display/flexsdk/Download+Flex+4</a>.<br/><strong>For more information on getting started with Flex 4 and Flash Builder 4, see the official <a href="http://bit.ly/dCkecm">Adobe Flex Team blog</a>.</strong></p>

<div class="wp_syntax"><div class="code"><pre class="mxml" style="font-family:monospace;"><span style="color: #000000;">&lt;?xml version=<span style="color: #ff0000;">&quot;1.0&quot;</span> encoding=<span style="color: #ff0000;">&quot;utf-8&quot;</span>?<span style="color: #7400FF;">&gt;</span></span>
<span style="color: #000000;"><span style="color: #808080; font-style: italic;">&lt;!-- http://blog.flexexamples.com/2010/02/25/preventing-item-selection-in-the-spark-list-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_List_changing_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>
&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 spark.events.IndexChangeEvent;</span>
&nbsp;
<span style="color: #000000;">            protected function lst_changingHandler<span style="color: #66cc66;">&#40;</span>evt:IndexChangeEvent<span style="color: #66cc66;">&#41;</span>:void <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">                evt.preventDefault<span style="color: #66cc66;">&#40;</span><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: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;selectedIndex:&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;{lst.selectedIndex}&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:FormItem</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:Form</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:controlBarContent</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:List</span> id=<span style="color: #ff0000;">&quot;lst&quot;</span></span>
<span style="color: #000000;">            changing=<span style="color: #ff0000;">&quot;lst_changingHandler(event);&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 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;justify&quot;</span></span>
<span style="color: #000000;">                              gap=<span style="color: #ff0000;">&quot;0&quot;</span></span>
<span style="color: #000000;">                              requestedRowCount=<span style="color: #ff0000;">&quot;5&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:dataProvider</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:ArrayList</span> source=<span style="color: #ff0000;">&quot;[The,Quick,Brown,Fox,Jumps,Over,The,Lazy,Dog]&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:dataProvider</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:List</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>

<div span="googleAdsLeaderboard">
<script type="text/javascript"><!--
google_ad_client = "pub-3325829455487492";
/* 728x90, created 7/15/09 */
google_ad_slot = "6403511741";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
<br />
</div>
<p class="information"><a href="http://dl.dropbox.com/u/4509565/FlexExamples_com/Spark_List_changing_test/srcview/index.html">View source</a> is enabled in the following example.</p>
<p><iframe src="http://dl.dropbox.com/u/4509565/FlexExamples_com/Spark_List_changing_test/main.html" width="100%" height="300"></iframe></p>
<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: 'Preventing item selection in the Spark List control in Flex 4 on FlexExamples.com',url: 'http://blog.flexexamples.com/2010/02/25/preventing-item-selection-in-the-spark-list-control-in-flex-4/',contentID: 'post-2523',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'changing,Gumbo,preventDefault()',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/02/25/preventing-item-selection-in-the-spark-list-control-in-flex-4/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Using embedded fonts with the MX AdvancedDataGrid control in Flex 4</title>
		<link>http://blog.flexexamples.com/2010/02/24/using-embedded-fonts-with-the-mx-advanceddatagrid-control-in-flex-4/</link>
		<comments>http://blog.flexexamples.com/2010/02/24/using-embedded-fonts-with-the-mx-advanceddatagrid-control-in-flex-4/#comments</comments>
		<pubDate>Wed, 24 Feb 2010 09:10:21 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[AdvancedDataGrid]]></category>
		<category><![CDATA[beta2]]></category>
		<category><![CDATA[embedAsCFF]]></category>
		<category><![CDATA[fontFamily]]></category>
		<category><![CDATA[Gumbo]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/?p=2519</guid>
		<description><![CDATA[<p>The following example shows how you can use an embedded font with the MX AdvancedDataGrid control in Flex 4 by setting the embedAsCFF and fontFamily styles.</p> <p></p> &#60;?xml version=&#34;1.0&#34; encoding=&#34;utf-8&#34;?&#62; &#60;!-- http://blog.flexexamples.com/2010/02/24/using-embedded-fonts-with-the-mx-advanceddatagrid-control-in-flex-4/ --&#62; &#60;s:Application name=&#34;MX_AdvancedDataGrid_fontFamily_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; &#160; &#60;fx:Style&#62; @namespace s &#34;library://ns.adobe.com/flex/spark&#34;; @namespace mx &#34;library://ns.adobe.com/flex/mx&#34;; &#160; @font-face { src: url(&#34;C:/Windows/Fonts/comic.ttf&#34;); fontFamily: myEmbeddedFont; fontWeight: normal; [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can use an embedded font with the MX AdvancedDataGrid control in Flex 4 by setting the <code>embedAsCFF</code> and <code>fontFamily</code> styles.</p>
<p><span id="more-2519"></span></p>
<p class="alert">The following example(s) require Flash Player 10 and the Adobe Flex 4 SDK. To download the Adobe Flash Builder 4 trial, see <a href="http://bit.ly/crThlI">http://www.adobe.com/products/flex/</a>. To download the latest nightly build of the Flex 4 SDK, see <a href="http://bit.ly/Flex4SDK">http://opensource.adobe.com/wiki/display/flexsdk/Download+Flex+4</a>.<br/><strong>For more information on getting started with Flex 4 and Flash Builder 4, see the official <a href="http://bit.ly/dCkecm">Adobe Flex Team blog</a>.</strong></p>

<div class="wp_syntax"><div class="code"><pre class="mxml" style="font-family:monospace;"><span style="color: #000000;">&lt;?xml version=<span style="color: #ff0000;">&quot;1.0&quot;</span> encoding=<span style="color: #ff0000;">&quot;utf-8&quot;</span>?<span style="color: #7400FF;">&gt;</span></span>
<span style="color: #000000;"><span style="color: #808080; font-style: italic;">&lt;!-- http://blog.flexexamples.com/2010/02/24/using-embedded-fonts-with-the-mx-advanceddatagrid-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;MX_AdvancedDataGrid_fontFamily_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>
&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;
        @font-face {
            src: url(&quot;C:/Windows/Fonts/comic.ttf&quot;);
            fontFamily: myEmbeddedFont;
            fontWeight: normal;
            embedAsCFF: false;
        }
&nbsp;
        mx|AdvancedDataGrid {
            fontFamily: myEmbeddedFont;
        }
    <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;mx:AdvancedDataGrid</span> id=<span style="color: #ff0000;">&quot;adg&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 style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:columns</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:AdvancedDataGridColumn</span> dataField=<span style="color: #ff0000;">&quot;@label&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:AdvancedDataGridColumn</span> dataField=<span style="color: #ff0000;">&quot;@data&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:columns</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:dataProvider</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:XMLListCollection</span> id=<span style="color: #ff0000;">&quot;dp&quot;</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:source</span><span style="color: #7400FF;">&gt;</span></span>
                    <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:XMLList</span><span style="color: #7400FF;">&gt;</span></span>
                        <span style="color: #000000;">&lt;product label=<span style="color: #ff0000;">&quot;Product 1&quot;</span> data=<span style="color: #ff0000;">&quot;3&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                        <span style="color: #000000;">&lt;product label=<span style="color: #ff0000;">&quot;Product 2&quot;</span> data=<span style="color: #ff0000;">&quot;1&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                        <span style="color: #000000;">&lt;product label=<span style="color: #ff0000;">&quot;Product 3&quot;</span> data=<span style="color: #ff0000;">&quot;4&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                        <span style="color: #000000;">&lt;product label=<span style="color: #ff0000;">&quot;Product 4&quot;</span> data=<span style="color: #ff0000;">&quot;1&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                        <span style="color: #000000;">&lt;product label=<span style="color: #ff0000;">&quot;Product 5&quot;</span> data=<span style="color: #ff0000;">&quot;5&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                        <span style="color: #000000;">&lt;product label=<span style="color: #ff0000;">&quot;Product 6&quot;</span> data=<span style="color: #ff0000;">&quot;9&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/fx:XMLList</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:source</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:XMLListCollection</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:dataProvider</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:AdvancedDataGrid</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>

<div span="googleAdsLeaderboard">
<script type="text/javascript"><!--
google_ad_client = "pub-3325829455487492";
/* 728x90, created 7/15/09 */
google_ad_slot = "6403511741";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
<br />
</div>
<p class="information"><a href="http://dl.dropbox.com/u/4509565/FlexExamples_com/MX_AdvancedDataGrid_fontFamily_test/srcview/index.html">View source</a> is enabled in the following example.</p>
<p><iframe src="http://dl.dropbox.com/u/4509565/FlexExamples_com/MX_AdvancedDataGrid_fontFamily_test/main.html" width="100%" height="300"></iframe></p>
<p>If you want to use a CFF/DefineFont4 font, you can set the <code>embedAsCFF</code> style to <em>true</em> and enable Flash Text Engine in MX components by selecting Project &gt; Properties from the main menu and then selecting the &#8220;Use Flash Text Engine in MX components&#8221; option in the Flex Compiler category.</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/02/24/using-embedded-fonts-with-the-mx-advanceddatagrid-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;MX_AdvancedDataGrid_fontFamily_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>
&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;
        @font-face {
            src: url(&quot;C:/Windows/Fonts/comic.ttf&quot;);
            fontFamily: myEmbeddedFont;
            fontWeight: normal;
            embedAsCFF: true;
        }
&nbsp;
        mx|AdvancedDataGrid {
            fontFamily: myEmbeddedFont;
        }
    <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;mx:AdvancedDataGrid</span> id=<span style="color: #ff0000;">&quot;adg&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 style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:columns</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:AdvancedDataGridColumn</span> dataField=<span style="color: #ff0000;">&quot;@label&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:AdvancedDataGridColumn</span> dataField=<span style="color: #ff0000;">&quot;@data&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:columns</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:dataProvider</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:XMLListCollection</span> id=<span style="color: #ff0000;">&quot;dp&quot;</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:source</span><span style="color: #7400FF;">&gt;</span></span>
                    <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:XMLList</span><span style="color: #7400FF;">&gt;</span></span>
                        <span style="color: #000000;">&lt;product label=<span style="color: #ff0000;">&quot;Product 1&quot;</span> data=<span style="color: #ff0000;">&quot;3&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                        <span style="color: #000000;">&lt;product label=<span style="color: #ff0000;">&quot;Product 2&quot;</span> data=<span style="color: #ff0000;">&quot;1&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                        <span style="color: #000000;">&lt;product label=<span style="color: #ff0000;">&quot;Product 3&quot;</span> data=<span style="color: #ff0000;">&quot;4&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                        <span style="color: #000000;">&lt;product label=<span style="color: #ff0000;">&quot;Product 4&quot;</span> data=<span style="color: #ff0000;">&quot;1&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                        <span style="color: #000000;">&lt;product label=<span style="color: #ff0000;">&quot;Product 5&quot;</span> data=<span style="color: #ff0000;">&quot;5&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                        <span style="color: #000000;">&lt;product label=<span style="color: #ff0000;">&quot;Product 6&quot;</span> data=<span style="color: #ff0000;">&quot;9&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/fx:XMLList</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:source</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:XMLListCollection</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:dataProvider</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:AdvancedDataGrid</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: 'Using embedded fonts with the MX AdvancedDataGrid control in Flex 4 on FlexExamples.com',url: 'http://blog.flexexamples.com/2010/02/24/using-embedded-fonts-with-the-mx-advanceddatagrid-control-in-flex-4/',contentID: 'post-2519',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'embedAsCFF,fontFamily,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/2010/02/24/using-embedded-fonts-with-the-mx-advanceddatagrid-control-in-flex-4/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>

