<?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; horizontalScrollPolicy</title>
	<atom:link href="http://blog.flexexamples.com/tag/horizontalscrollpolicy/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>Modifying the corner white box on an MX Container when scroll bars are visible in Flex</title>
		<link>http://blog.flexexamples.com/2010/05/05/modifying-the-corner-white-box-on-an-mx-container-when-scroll-bars-are-visible-in-flex/</link>
		<comments>http://blog.flexexamples.com/2010/05/05/modifying-the-corner-white-box-on-an-mx-container-when-scroll-bars-are-visible-in-flex/#comments</comments>
		<pubDate>Wed, 05 May 2010 23:51:13 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[HBox]]></category>
		<category><![CDATA[alpha]]></category>
		<category><![CDATA[backgroundAlpha]]></category>
		<category><![CDATA[backgroundColor]]></category>
		<category><![CDATA[getChildByName()]]></category>
		<category><![CDATA[horizontalScrollPolicy]]></category>
		<category><![CDATA[rawChildren]]></category>
		<category><![CDATA[verticalScrollPolicy]]></category>
		<category><![CDATA[visible]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/?p=2938</guid>
		<description><![CDATA[<p>The following example shows how you can modify the visibility and alpha of the white box in the lower-right corner of an MX Container in Flex when both the horizontal and vertical scroll bars are visible by using the rawChildren property and getChildByName() method.</p> <p></p> &#60;?xml version=&#34;1.0&#34; encoding=&#34;utf-8&#34;?&#62; &#60;!-- http://blog.flexexamples.com/2010/05/05/modifying-the-corner-white-box-on-an-mx-container-when-scroll-bars-are-visible-in-flex/ --&#62; &#60;mx:Application name=&#34;MX_Container_whiteBox_alpha_test&#34; xmlns:mx=&#34;http://www.adobe.com/2006/mxml&#34; layout=&#34;vertical&#34; [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can modify the visibility and alpha of the white box in the lower-right corner of an MX Container in Flex when both the horizontal and vertical scroll bars are visible by using the <code>rawChildren</code> property and <code>getChildByName()</code> method.</p>
<p><span id="more-2938"></span></p>

<div class="wp_syntax"><div class="code"><pre class="mxml" style="font-family:monospace;"><span style="color: #000000;">&lt;?xml version=<span style="color: #ff0000;">&quot;1.0&quot;</span> encoding=<span style="color: #ff0000;">&quot;utf-8&quot;</span>?<span style="color: #7400FF;">&gt;</span></span>
<span style="color: #000000;"><span style="color: #808080; font-style: italic;">&lt;!-- http://blog.flexexamples.com/2010/05/05/modifying-the-corner-white-box-on-an-mx-container-when-scroll-bars-are-visible-in-flex/ --&gt;</span></span>
<span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Application</span> name=<span style="color: #ff0000;">&quot;MX_Container_whiteBox_alpha_test&quot;</span></span>
<span style="color: #000000;">        xmlns:mx=<span style="color: #ff0000;">&quot;http://www.adobe.com/2006/mxml&quot;</span></span>
<span style="color: #000000;">        layout=<span style="color: #ff0000;">&quot;vertical&quot;</span></span>
<span style="color: #000000;">        verticalAlign=<span style="color: #ff0000;">&quot;middle&quot;</span></span>
<span style="color: #000000;">        backgroundGradientColors=<span style="color: #ff0000;">&quot;[#FF0000,#FF00FF]&quot;</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #339933;">&lt;mx:Script&gt;</span>
<span style="color: #339933;">        &lt;![CDATA[</span>
<span style="color: #339933;">            import mx.events.FlexEvent;</span>
&nbsp;
<span style="color: #339933;">            protected var wBox:DisplayObject;</span>
&nbsp;
<span style="color: #339933;">            protected function hBox_creationCompleteHandler(evt:FlexEvent):void {</span>
<span style="color: #339933;">                wBox = hBox.rawChildren.getChildByName(&quot;whiteBox&quot;);</span>
<span style="color: #339933;">            }</span>
&nbsp;
<span style="color: #339933;">            protected function sldr1_changeHandler(evt:Event):void {</span>
<span style="color: #339933;">                wBox.alpha = sldr1.value;</span>
<span style="color: #339933;">            }</span>
&nbsp;
<span style="color: #339933;">            protected function chckBx_changeHandler(evt:Event):void {</span>
<span style="color: #339933;">                wBox.visible = chckBx.selected;</span>
<span style="color: #339933;">            }</span>
<span style="color: #339933;">        ]]&gt;</span>
<span style="color: #339933;">    &lt;/mx:Script&gt;</span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:ApplicationControlBar</span> dock=<span style="color: #ff0000;">&quot;true&quot;</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Form</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:FormItem</span> label=<span style="color: #ff0000;">&quot;whiteBox alpha:&quot;</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:HSlider</span> id=<span style="color: #ff0000;">&quot;sldr1&quot;</span></span>
<span style="color: #000000;">                        minimum=<span style="color: #ff0000;">&quot;0.0&quot;</span> maximum=<span style="color: #ff0000;">&quot;1.0&quot;</span></span>
<span style="color: #000000;">                        value=<span style="color: #ff0000;">&quot;1.0&quot;</span></span>
<span style="color: #000000;">                        snapInterval=<span style="color: #ff0000;">&quot;0.1&quot;</span></span>
<span style="color: #000000;">                        tickInterval=<span style="color: #ff0000;">&quot;0.1&quot;</span></span>
<span style="color: #000000;">                        liveDragging=<span style="color: #ff0000;">&quot;true&quot;</span></span>
<span style="color: #000000;">                        change=<span style="color: #ff0000;">&quot;sldr1_changeHandler(event);&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:FormItem</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:FormItem</span> label=<span style="color: #ff0000;">&quot;whiteBox visible:&quot;</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:CheckBox</span> id=<span style="color: #ff0000;">&quot;chckBx&quot;</span></span>
<span style="color: #000000;">                        selected=<span style="color: #ff0000;">&quot;true&quot;</span></span>
<span style="color: #000000;">                        change=<span style="color: #ff0000;">&quot;chckBx_changeHandler(event);&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:FormItem</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:FormItem</span> label=<span style="color: #ff0000;">&quot;HBox backgroundAlpha:&quot;</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:HSlider</span> id=<span style="color: #ff0000;">&quot;sldr2&quot;</span></span>
<span style="color: #000000;">                        minimum=<span style="color: #ff0000;">&quot;0.0&quot;</span> maximum=<span style="color: #ff0000;">&quot;1.0&quot;</span></span>
<span style="color: #000000;">                        value=<span style="color: #ff0000;">&quot;1.0&quot;</span></span>
<span style="color: #000000;">                        snapInterval=<span style="color: #ff0000;">&quot;0.1&quot;</span></span>
<span style="color: #000000;">                        tickInterval=<span style="color: #ff0000;">&quot;0.1&quot;</span></span>
<span style="color: #000000;">                        liveDragging=<span style="color: #ff0000;">&quot;true&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:FormItem</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:FormItem</span> label=<span style="color: #ff0000;">&quot;HBox backgroundColor:&quot;</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:ColorPicker</span> id=<span style="color: #ff0000;">&quot;clrPckr&quot;</span></span>
<span style="color: #000000;">                        selectedColor=<span style="color: #ff0000;">&quot;green&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:FormItem</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:Form</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:ApplicationControlBar</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:HBox</span> id=<span style="color: #ff0000;">&quot;hBox&quot;</span></span>
<span style="color: #000000;">            backgroundAlpha=<span style="color: #ff0000;">&quot;{sldr2.value}&quot;</span></span>
<span style="color: #000000;">            backgroundColor=<span style="color: #ff0000;">&quot;{clrPckr.selectedColor}&quot;</span></span>
<span style="color: #000000;">            horizontalScrollPolicy=<span style="color: #ff0000;">&quot;on&quot;</span> verticalScrollPolicy=<span style="color: #ff0000;">&quot;on&quot;</span></span>
<span style="color: #000000;">            width=<span style="color: #ff0000;">&quot;240&quot;</span> height=<span style="color: #ff0000;">&quot;160&quot;</span></span>
<span style="color: #000000;">            paddingLeft=<span style="color: #ff0000;">&quot;10&quot;</span> paddingRight=<span style="color: #ff0000;">&quot;10&quot;</span></span>
<span style="color: #000000;">            paddingTop=<span style="color: #ff0000;">&quot;10&quot;</span> paddingBottom=<span style="color: #ff0000;">&quot;10&quot;</span></span>
<span style="color: #000000;">            creationComplete=<span style="color: #ff0000;">&quot;hBox_creationCompleteHandler(event);&quot;</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Button</span> label=<span style="color: #ff0000;">&quot;MX Button&quot;</span> width=<span style="color: #ff0000;">&quot;300&quot;</span> height=<span style="color: #ff0000;">&quot;100%&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:HBox</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
<span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:Application</span><span style="color: #7400FF;">&gt;</span></span></pre></div></div>

<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Modifying the corner white box on an MX Container when scroll bars are visible in Flex on FlexExamples.com',url: 'http://blog.flexexamples.com/2010/05/05/modifying-the-corner-white-box-on-an-mx-container-when-scroll-bars-are-visible-in-flex/',contentID: 'post-2938',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'alpha,backgroundAlpha,backgroundColor,getChildByName(),horizontalScrollPolicy,rawChildren,verticalScrollPolicy,visible',providerName: 'FlexExamples.com',styling: 'text' });return false" class="evernoteSiteMemoryLink"><img src="http://static.evernote.com/article-clipper-remember.png" class="evernoteSiteMemoryButton" />
				</a>				<div class="evernoteSiteMemoryClear">&nbsp;</div>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.flexexamples.com/2010/05/05/modifying-the-corner-white-box-on-an-mx-container-when-scroll-bars-are-visible-in-flex/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Setting the horizontal scroll policy on a Spark DropDownList control in Flex 4</title>
		<link>http://blog.flexexamples.com/2010/02/06/setting-the-horizontal-scroll-policy-on-a-spark-dropdownlist-control-in-flex-4/</link>
		<comments>http://blog.flexexamples.com/2010/02/06/setting-the-horizontal-scroll-policy-on-a-spark-dropdownlist-control-in-flex-4/#comments</comments>
		<pubDate>Sat, 06 Feb 2010 16:39:27 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[beta2]]></category>
		<category><![CDATA[DropDownList (Spark)]]></category>
		<category><![CDATA[Gumbo]]></category>
		<category><![CDATA[horizontalScrollPolicy]]></category>
		<category><![CDATA[scroller]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/?p=2410</guid>
		<description><![CDATA[<p>The following example shows how you can set the horizontal scroll policy on a Spark DropDownList control in Flex 4 by setting the horizontalScrollPolicy style on the drop down menu&#8217;s Scroller skin part.</p> <p></p> &#60;?xml version=&#34;1.0&#34; encoding=&#34;utf-8&#34;?&#62; &#60;!-- http://blog.flexexamples.com/2010/02/06/setting-the-horizontal-scroll-policy-on-a-spark-dropdownlist-control-in-flex-4/ --&#62; &#60;s:Application name=&#34;Spark_DropDownList_scroller_horizontalScrollPolicy_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 mx.core.ScrollPolicy; &#93;&#93;&#62; &#60;/fx:Script&#62; &#160; &#60;s:DropDownList id=&#34;ddl&#34; [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can set the horizontal scroll policy on a Spark DropDownList control in Flex 4 by setting the <code>horizontalScrollPolicy</code> style on the drop down menu&#8217;s Scroller skin part.</p>
<p><span id="more-2410"></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/06/setting-the-horizontal-scroll-policy-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_scroller_horizontalScrollPolicy_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 mx.core.ScrollPolicy;</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;">            width=<span style="color: #ff0000;">&quot;100&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;">            open=<span style="color: #ff0000;">&quot;ddl.scroller.setStyle('horizontalScrollPolicy', ScrollPolicy.OFF);&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;[Accordion,ApplicationControlBar,Alert,Box,Button,ButtonBar,Canvas,ColorPicker]&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_scroller_horizontalScrollPolicy_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_scroller_horizontalScrollPolicy_test/main.html" width="100%" height="200"></iframe></p>
<p>Or you can set the <code>horizontalScrollPolicy</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/02/06/setting-the-horizontal-scroll-policy-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_scroller_horizontalScrollPolicy_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;;
&nbsp;
        s|Group#dropDown #scroller {
            horizontalScrollPolicy: off;
        }
    <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;">            width=<span style="color: #ff0000;">&quot;100&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;[Accordion,ApplicationControlBar,Alert,Box,Button,ButtonBar,Canvas,ColorPicker]&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 horizontal scroll policy on a Spark DropDownList control in Flex 4 on FlexExamples.com',url: 'http://blog.flexexamples.com/2010/02/06/setting-the-horizontal-scroll-policy-on-a-spark-dropdownlist-control-in-flex-4/',contentID: 'post-2410',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'Gumbo,horizontalScrollPolicy,scroller',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/06/setting-the-horizontal-scroll-policy-on-a-spark-dropdownlist-control-in-flex-4/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Setting a custom horizontal scroll bar skin on a Spark List control in Flex 4</title>
		<link>http://blog.flexexamples.com/2009/11/04/setting-a-custom-horizontal-scroll-bar-skin-on-a-spark-list-control-in-flex-4/</link>
		<comments>http://blog.flexexamples.com/2009/11/04/setting-a-custom-horizontal-scroll-bar-skin-on-a-spark-list-control-in-flex-4/#comments</comments>
		<pubDate>Thu, 05 Nov 2009 01:14:04 +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[horizontalScrollBar]]></category>
		<category><![CDATA[horizontalScrollPolicy]]></category>
		<category><![CDATA[scroller]]></category>
		<category><![CDATA[skinClass]]></category>
		<category><![CDATA[verticalScrollPolicy]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/?p=2166</guid>
		<description><![CDATA[<p>The following example shows how you can apply a custom horizontal scroll bar skin on the Spark List control in Flex 4 by setting the skinClass style.</p> <p>Full code after the jump.</p> <p></p> &#60;?xml version=&#34;1.0&#34; encoding=&#34;utf-8&#34;?&#62; &#60;!-- http://blog.flexexamples.com/2009/11/04/setting-a-custom-horizontal-scroll-bar-skin-on-a-spark-list-control-in-flex-4/ --&#62; &#60;s:Application name=&#34;Spark_List_HScrollBar_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/halo&#34;&#62; &#160; &#60;fx:Style&#62; @namespace s &#34;library://ns.adobe.com/flex/spark&#34;; &#160; s&#124;List s&#124;Scroller { horizontalScrollPolicy: on; [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can apply a custom horizontal scroll bar skin on the Spark List control in Flex 4 by setting the <code>skinClass</code> style.</p>
<p>Full code after the jump.</p>
<p><span id="more-2166"></span></p>
<p class="alert">The following example(s) require Flash Player 10 and the Adobe Flex 4 SDK. To download the Adobe Flash Builder 4 trial, see <a href="http://bit.ly/crThlI">http://www.adobe.com/products/flex/</a>. To download the latest nightly build of the Flex 4 SDK, see <a href="http://bit.ly/Flex4SDK">http://opensource.adobe.com/wiki/display/flexsdk/Download+Flex+4</a>.<br/><strong>For more information on getting started with Flex 4 and Flash Builder 4, see the official <a href="http://bit.ly/dCkecm">Adobe Flex Team blog</a>.</strong></p>

<div class="wp_syntax"><div class="code"><pre class="mxml" style="font-family:monospace;"><span style="color: #000000;">&lt;?xml version=<span style="color: #ff0000;">&quot;1.0&quot;</span> encoding=<span style="color: #ff0000;">&quot;utf-8&quot;</span>?<span style="color: #7400FF;">&gt;</span></span>
<span style="color: #000000;"><span style="color: #808080; font-style: italic;">&lt;!-- http://blog.flexexamples.com/2009/11/04/setting-a-custom-horizontal-scroll-bar-skin-on-a-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_HScrollBar_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/halo&quot;</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Style</span><span style="color: #7400FF;">&gt;</span></span>
        @namespace s &quot;library://ns.adobe.com/flex/spark&quot;;
&nbsp;
        s|List s|Scroller {
            horizontalScrollPolicy: on;
            verticalScrollPolicy: on;
        }
&nbsp;
        s|List s|HScrollBar {
            skinClass: ClassReference(&quot;skins.TrackThumbOnlyHSBSkin&quot;);
        }
    <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:List</span> id=<span style="color: #ff0000;">&quot;list&quot;</span> width=<span style="color: #ff0000;">&quot;100&quot;</span> height=<span style="color: #ff0000;">&quot;100&quot;</span> horizontalCenter=<span style="color: #ff0000;">&quot;0&quot;</span> verticalCenter=<span style="color: #ff0000;">&quot;0&quot;</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s: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> label=<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;fx:Object</span> label=<span style="color: #ff0000;">&quot;One&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> label=<span style="color: #ff0000;">&quot;Two&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> label=<span style="color: #ff0000;">&quot;Three&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> label=<span style="color: #ff0000;">&quot;Four&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> label=<span style="color: #ff0000;">&quot;Five&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> label=<span style="color: #ff0000;">&quot;Six&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> label=<span style="color: #ff0000;">&quot;Seven&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> label=<span style="color: #ff0000;">&quot;Eight&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> label=<span style="color: #ff0000;">&quot;Nine&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;/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 HScrollBar skin class, <code>skins/TrackThumbOnlyHSBSkin.mxml</code>, 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/2009/11/04/setting-a-custom-horizontal-scroll-bar-skin-on-a-spark-list-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;TrackThumbOnlyHSBSkin&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;35&quot;</span> minHeight=<span style="color: #ff0000;">&quot;15&quot;</span></span>
<span style="color: #000000;">        alpha.disabled=<span style="color: #ff0000;">&quot;0.5&quot;</span></span>
<span style="color: #000000;">        alpha.inactive=<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:State</span> name=<span style="color: #ff0000;">&quot;inactive&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>
        <span style="color: #000000;">&lt;!<span style="color: #66cc66;">&#91;</span>CDATA<span style="color: #66cc66;">&#91;</span> </span>
<span style="color: #000000;">            <span style="color: #66cc66;">&#91;</span>HostComponent<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;spark.components.HScrollBar&quot;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#93;</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: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 scroll bar, 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;">                useBaseColor = 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;!--- Defines the skin class for the HScrollBarSkin's track. The default skin class is HScrollBarTrackSkin. --&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Button</span> id=<span style="color: #ff0000;">&quot;track&quot;</span> left=<span style="color: #ff0000;">&quot;0&quot;</span> right=<span style="color: #ff0000;">&quot;0&quot;</span> width=<span style="color: #ff0000;">&quot;54&quot;</span> </span>
<span style="color: #000000;">              focusEnabled=<span style="color: #ff0000;">&quot;false&quot;</span></span>
<span style="color: #000000;">              skinClass=<span style="color: #ff0000;">&quot;spark.skins.spark.HScrollBarTrackSkin&quot;</span></span>
<span style="color: #000000;">              baseColor=<span style="color: #ff0000;">&quot;haloGreen&quot;</span><span style="color: #7400FF;">/&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #808080; font-style: italic;">&lt;!--- Defines the skin class for the HScrollBarSkin's thumb. The default skin class is HScrollBarThumbSkin. --&gt;</span></span>
    <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;">              focusEnabled=<span style="color: #ff0000;">&quot;false&quot;</span> visible.inactive=<span style="color: #ff0000;">&quot;false&quot;</span></span>
<span style="color: #000000;">              skinClass=<span style="color: #ff0000;">&quot;spark.skins.spark.HScrollBarThumbSkin&quot;</span></span>
<span style="color: #000000;">              baseColor=<span style="color: #ff0000;">&quot;haloBlue&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="information"><a href="http://blog.flexexamples.com/wp-content/uploads/spark/Spark_List_HScrollBar_skinClass_test/srcview/">View source</a> is enabled in the following example.</p>
<p><iframe src="http://blog.flexexamples.com/wp-content/uploads/spark/Spark_List_HScrollBar_skinClass_test/bin/main.html" width="100%" height="200"></iframe></p>
<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>Or, you can set the <code>horizontalScrollPolicy</code>, <code>verticalScrollPolicy</code>, and <code>skinClass</code> styles using ActionScript, as seen in the following example:</p>

<div class="wp_syntax"><div class="code"><pre class="mxml" style="font-family:monospace;"><span style="color: #000000;">&lt;?xml version=<span style="color: #ff0000;">&quot;1.0&quot;</span> encoding=<span style="color: #ff0000;">&quot;utf-8&quot;</span>?<span style="color: #7400FF;">&gt;</span></span>
<span style="color: #000000;"><span style="color: #808080; font-style: italic;">&lt;!-- http://blog.flexexamples.com/2009/11/04/setting-a-custom-horizontal-scroll-bar-skin-on-a-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_HScrollBar_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/halo&quot;</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Script</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;">&lt;!<span style="color: #66cc66;">&#91;</span>CDATA<span style="color: #66cc66;">&#91;</span></span>
<span style="color: #000000;">            import mx.core.ScrollPolicy;</span>
<span style="color: #000000;">            import skins.TrackThumbOnlyHSBSkin;</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;">                list.scroller.setStyle<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;horizontalScrollPolicy&quot;</span>, ScrollPolicy.ON<span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                list.scroller.setStyle<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;verticalScrollPolicy&quot;</span>, ScrollPolicy.ON<span style="color: #66cc66;">&#41;</span>;</span>
&nbsp;
<span style="color: #000000;">                list.scroller.horizontalScrollBar.setStyle<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;skinClass&quot;</span>, TrackThumbOnlyHSBSkin<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;list&quot;</span></span>
<span style="color: #000000;">            width=<span style="color: #ff0000;">&quot;100&quot;</span> height=<span style="color: #ff0000;">&quot;100&quot;</span></span>
<span style="color: #000000;">            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;init();&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><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> label=<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;fx:Object</span> label=<span style="color: #ff0000;">&quot;One&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> label=<span style="color: #ff0000;">&quot;Two&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> label=<span style="color: #ff0000;">&quot;Three&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> label=<span style="color: #ff0000;">&quot;Four&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> label=<span style="color: #ff0000;">&quot;Five&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> label=<span style="color: #ff0000;">&quot;Six&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> label=<span style="color: #ff0000;">&quot;Seven&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> label=<span style="color: #ff0000;">&quot;Eight&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> label=<span style="color: #ff0000;">&quot;Nine&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;/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 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 a custom horizontal scroll bar skin on a Spark List control in Flex 4 on FlexExamples.com',url: 'http://blog.flexexamples.com/2009/11/04/setting-a-custom-horizontal-scroll-bar-skin-on-a-spark-list-control-in-flex-4/',contentID: 'post-2166',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'Gumbo,horizontalScrollBar,horizontalScrollPolicy,scroller,skinClass,verticalScrollPolicy',providerName: 'FlexExamples.com',styling: 'text' });return false" class="evernoteSiteMemoryLink"><img src="http://static.evernote.com/article-clipper-remember.png" class="evernoteSiteMemoryButton" />
				</a>				<div class="evernoteSiteMemoryClear">&nbsp;</div>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.flexexamples.com/2009/11/04/setting-a-custom-horizontal-scroll-bar-skin-on-a-spark-list-control-in-flex-4/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Styling the horizontal and vertical scroll bars on a Spark List control in Flex 4</title>
		<link>http://blog.flexexamples.com/2009/11/04/styling-the-horizontal-and-vertical-scroll-bars-on-a-spark-list-control-in-flex-4/</link>
		<comments>http://blog.flexexamples.com/2009/11/04/styling-the-horizontal-and-vertical-scroll-bars-on-a-spark-list-control-in-flex-4/#comments</comments>
		<pubDate>Wed, 04 Nov 2009 14:40:54 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[Flex4]]></category>
		<category><![CDATA[HScrollBar (Spark)]]></category>
		<category><![CDATA[List (Spark)]]></category>
		<category><![CDATA[Scroller (Spark)]]></category>
		<category><![CDATA[VScrollBar (Spark)]]></category>
		<category><![CDATA[chromeColor]]></category>
		<category><![CDATA[Gumbo]]></category>
		<category><![CDATA[horizontalScrollPolicy]]></category>
		<category><![CDATA[scroller]]></category>
		<category><![CDATA[verticalScrollPolicy]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/?p=2148</guid>
		<description><![CDATA[<p>The following example shows how you can set a base theme color on a Spark List control&#8217;s horizontal and vertical scroll bar by setting the chromeColor style.</p> <p></p> &#60;?xml version=&#34;1.0&#34; encoding=&#34;utf-8&#34;?&#62; &#60;!-- http://blog.flexexamples.com/2009/11/04/styling-the-horizontal-and-vertical-scroll-bars-on-a-spark-list-control-in-flex-4/ --&#62; &#60;s:Application name=&#34;Spark_List_scroller_baseColor_test&#34; xmlns:fx=&#34;http://ns.adobe.com/mxml/2009&#34; xmlns:s=&#34;library://ns.adobe.com/flex/spark&#34; viewSourceURL=&#34;srcview/index.html&#34;&#62; &#160; &#60;fx:Style&#62; @namespace s &#34;library://ns.adobe.com/flex/spark&#34;; &#160; s&#124;List s&#124;Scroller { horizontalScrollPolicy: on; verticalScrollPolicy: on; } &#160; s&#124;List [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can set a base theme color on a Spark List control&#8217;s horizontal and vertical scroll bar by setting the <code>chromeColor</code> style.</p>
<p><span id="more-2148"></span></p>
<p class="alert">The following example(s) require Flash Player 10 and the Adobe Flex 4 SDK. To download the Adobe Flash Builder 4 trial, see <a href="http://bit.ly/crThlI">http://www.adobe.com/products/flex/</a>. To download the latest nightly build of the Flex 4 SDK, see <a href="http://bit.ly/Flex4SDK">http://opensource.adobe.com/wiki/display/flexsdk/Download+Flex+4</a>.<br/><strong>For more information on getting started with Flex 4 and Flash Builder 4, see the official <a href="http://bit.ly/dCkecm">Adobe Flex Team blog</a>.</strong></p>

<div class="wp_syntax"><div class="code"><pre class="mxml" style="font-family:monospace;"><span style="color: #000000;">&lt;?xml version=<span style="color: #ff0000;">&quot;1.0&quot;</span> encoding=<span style="color: #ff0000;">&quot;utf-8&quot;</span>?<span style="color: #7400FF;">&gt;</span></span> 
<span style="color: #000000;"><span style="color: #808080; font-style: italic;">&lt;!-- http://blog.flexexamples.com/2009/11/04/styling-the-horizontal-and-vertical-scroll-bars-on-a-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_scroller_baseColor_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> viewSourceURL=<span style="color: #ff0000;">&quot;srcview/index.html&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;;
&nbsp;
        s|List s|Scroller {
            horizontalScrollPolicy: on;
            verticalScrollPolicy: on;
        }
&nbsp;
        s|List s|ScrollBarBase {
            chromeColor: 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:List</span> id=<span style="color: #ff0000;">&quot;lst&quot;</span></span>
<span style="color: #000000;">            width=<span style="color: #ff0000;">&quot;150&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: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:String</span><span style="color: #7400FF;">&gt;</span></span>One<span style="color: #000000;"><span style="color: #7400FF;">&lt;/fx:String</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:String</span><span style="color: #7400FF;">&gt;</span></span>Two Two<span style="color: #000000;"><span style="color: #7400FF;">&lt;/fx:String</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:String</span><span style="color: #7400FF;">&gt;</span></span>Three Three Three<span style="color: #000000;"><span style="color: #7400FF;">&lt;/fx:String</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:String</span><span style="color: #7400FF;">&gt;</span></span>Four Four Four Four<span style="color: #000000;"><span style="color: #7400FF;">&lt;/fx:String</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:String</span><span style="color: #7400FF;">&gt;</span></span>Five Five Five Five Five<span style="color: #000000;"><span style="color: #7400FF;">&lt;/fx:String</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:String</span><span style="color: #7400FF;">&gt;</span></span>Six Six Six Six Six Six<span style="color: #000000;"><span style="color: #7400FF;">&lt;/fx:String</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:String</span><span style="color: #7400FF;">&gt;</span></span>Seven Seven Seven Seven Seven Seven Seven<span style="color: #000000;"><span style="color: #7400FF;">&lt;/fx:String</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:String</span><span style="color: #7400FF;">&gt;</span></span>Eight Eight Eight Eight Eight Eight Eight Eight<span style="color: #000000;"><span style="color: #7400FF;">&lt;/fx:String</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:String</span><span style="color: #7400FF;">&gt;</span></span>Nine Nine Nine Nine Nine Nine Nine Nine Nine<span style="color: #000000;"><span style="color: #7400FF;">&lt;/fx:String</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;/s:dataProvider</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:layout</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:VerticalLayout</span> gap=<span style="color: #ff0000;">&quot;0&quot;</span></span>
<span style="color: #000000;">                    horizontalAlign=<span style="color: #ff0000;">&quot;contentJustify&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: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_scroller_chromeColor_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_scroller_chromeColor_test/main.html" width="100%" height="300"></iframe></p>
<p>If you wanted to style the horizontal scroll bar and vertical scroll bar separately, you could apply styles to the s|HScrollBar and s|VScrollBar separately instead of using the generic s|ScrollBar selector, as seen in the following example:</p>

<div class="wp_syntax"><div class="code"><pre class="mxml" style="font-family:monospace;"><span style="color: #000000;">&lt;?xml version=<span style="color: #ff0000;">&quot;1.0&quot;</span> encoding=<span style="color: #ff0000;">&quot;utf-8&quot;</span>?<span style="color: #7400FF;">&gt;</span></span> 
<span style="color: #000000;"><span style="color: #808080; font-style: italic;">&lt;!-- http://blog.flexexamples.com/2009/11/04/styling-the-horizontal-and-vertical-scroll-bars-on-a-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_scroller_chromeColor_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 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;;
&nbsp;
        s|List s|Scroller {
            horizontalScrollPolicy: on;
            verticalScrollPolicy: on;
        }
&nbsp;
        s|List s|VScrollBar {
            chromeColor: haloGreen;
        }
&nbsp;
        s|List s|HScrollBar {
            chromeColor: haloBlue;
        }
    <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:List</span> id=<span style="color: #ff0000;">&quot;lst&quot;</span></span>
<span style="color: #000000;">            width=<span style="color: #ff0000;">&quot;150&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: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:String</span><span style="color: #7400FF;">&gt;</span></span>One<span style="color: #000000;"><span style="color: #7400FF;">&lt;/fx:String</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:String</span><span style="color: #7400FF;">&gt;</span></span>Two Two<span style="color: #000000;"><span style="color: #7400FF;">&lt;/fx:String</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:String</span><span style="color: #7400FF;">&gt;</span></span>Three Three Three<span style="color: #000000;"><span style="color: #7400FF;">&lt;/fx:String</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:String</span><span style="color: #7400FF;">&gt;</span></span>Four Four Four Four<span style="color: #000000;"><span style="color: #7400FF;">&lt;/fx:String</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:String</span><span style="color: #7400FF;">&gt;</span></span>Five Five Five Five Five<span style="color: #000000;"><span style="color: #7400FF;">&lt;/fx:String</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:String</span><span style="color: #7400FF;">&gt;</span></span>Six Six Six Six Six Six<span style="color: #000000;"><span style="color: #7400FF;">&lt;/fx:String</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:String</span><span style="color: #7400FF;">&gt;</span></span>Seven Seven Seven Seven Seven Seven Seven<span style="color: #000000;"><span style="color: #7400FF;">&lt;/fx:String</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:String</span><span style="color: #7400FF;">&gt;</span></span>Eight Eight Eight Eight Eight Eight Eight Eight<span style="color: #000000;"><span style="color: #7400FF;">&lt;/fx:String</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:String</span><span style="color: #7400FF;">&gt;</span></span>Nine Nine Nine Nine Nine Nine Nine Nine Nine<span style="color: #000000;"><span style="color: #7400FF;">&lt;/fx:String</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;/s:dataProvider</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:layout</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:VerticalLayout</span> gap=<span style="color: #ff0000;">&quot;0&quot;</span></span>
<span style="color: #000000;">                    horizontalAlign=<span style="color: #ff0000;">&quot;contentJustify&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: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 could set the <code>chromeColor</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/2009/11/04/styling-the-horizontal-and-vertical-scroll-bars-on-a-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_scroller_baseColor_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 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.core.ScrollPolicy;</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;">                lst.scroller.setStyle<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;horizontalScrollPolicy&quot;</span>, ScrollPolicy.ON<span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                lst.scroller.setStyle<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;verticalScrollPolicy&quot;</span>, ScrollPolicy.ON<span style="color: #66cc66;">&#41;</span>;</span>
&nbsp;
<span style="color: #000000;">                lst.scroller.verticalScrollBar.setStyle<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;chromeColor&quot;</span>, <span style="color: #ff0000;">&quot;haloGreen&quot;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                lst.scroller.horizontalScrollBar.setStyle<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;chromeColor&quot;</span>, <span style="color: #ff0000;">&quot;haloBlue&quot;</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:List</span> id=<span style="color: #ff0000;">&quot;lst&quot;</span></span>
<span style="color: #000000;">            width=<span style="color: #ff0000;">&quot;150&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;init();&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><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:String</span><span style="color: #7400FF;">&gt;</span></span>One<span style="color: #000000;"><span style="color: #7400FF;">&lt;/fx:String</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:String</span><span style="color: #7400FF;">&gt;</span></span>Two Two<span style="color: #000000;"><span style="color: #7400FF;">&lt;/fx:String</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:String</span><span style="color: #7400FF;">&gt;</span></span>Three Three Three<span style="color: #000000;"><span style="color: #7400FF;">&lt;/fx:String</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:String</span><span style="color: #7400FF;">&gt;</span></span>Four Four Four Four<span style="color: #000000;"><span style="color: #7400FF;">&lt;/fx:String</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:String</span><span style="color: #7400FF;">&gt;</span></span>Five Five Five Five Five<span style="color: #000000;"><span style="color: #7400FF;">&lt;/fx:String</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:String</span><span style="color: #7400FF;">&gt;</span></span>Six Six Six Six Six Six<span style="color: #000000;"><span style="color: #7400FF;">&lt;/fx:String</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:String</span><span style="color: #7400FF;">&gt;</span></span>Seven Seven Seven Seven Seven Seven Seven<span style="color: #000000;"><span style="color: #7400FF;">&lt;/fx:String</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:String</span><span style="color: #7400FF;">&gt;</span></span>Eight Eight Eight Eight Eight Eight Eight Eight<span style="color: #000000;"><span style="color: #7400FF;">&lt;/fx:String</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:String</span><span style="color: #7400FF;">&gt;</span></span>Nine Nine Nine Nine Nine Nine Nine Nine Nine<span style="color: #000000;"><span style="color: #7400FF;">&lt;/fx:String</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;/s:dataProvider</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:layout</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:VerticalLayout</span> gap=<span style="color: #ff0000;">&quot;0&quot;</span></span>
<span style="color: #000000;">                    horizontalAlign=<span style="color: #ff0000;">&quot;contentJustify&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: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: 'Styling the horizontal and vertical scroll bars on a Spark List control in Flex 4 on FlexExamples.com',url: 'http://blog.flexexamples.com/2009/11/04/styling-the-horizontal-and-vertical-scroll-bars-on-a-spark-list-control-in-flex-4/',contentID: 'post-2148',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'chromeColor,Gumbo,horizontalScrollPolicy,scroller,verticalScrollPolicy',providerName: 'FlexExamples.com',styling: 'text' });return false" class="evernoteSiteMemoryLink"><img src="http://static.evernote.com/article-clipper-remember.png" class="evernoteSiteMemoryButton" />
				</a>				<div class="evernoteSiteMemoryClear">&nbsp;</div>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.flexexamples.com/2009/11/04/styling-the-horizontal-and-vertical-scroll-bars-on-a-spark-list-control-in-flex-4/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Toggling horizontal and vertical scroll bars on a Spark List control in Flex 4</title>
		<link>http://blog.flexexamples.com/2009/10/05/toggling-horizontal-and-vertical-scroll-bars-on-a-spark-list-control-in-flex-4/</link>
		<comments>http://blog.flexexamples.com/2009/10/05/toggling-horizontal-and-vertical-scroll-bars-on-a-spark-list-control-in-flex-4/#comments</comments>
		<pubDate>Tue, 06 Oct 2009 06:59:44 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[beta2]]></category>
		<category><![CDATA[Scroller (Spark)]]></category>
		<category><![CDATA[Gumbo]]></category>
		<category><![CDATA[horizontalScrollPolicy]]></category>
		<category><![CDATA[scroller]]></category>
		<category><![CDATA[verticalScrollPolicy]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/?p=2104</guid>
		<description><![CDATA[<p>The following example shows how you can show or hide horizontal and vertical scroll bars on a Spark List control in Flex 4 by setting the horizontalScrollPolicy and/or verticalScrollPolicy styles.</p> <p>Full code after the jump.</p> <p></p> &#60;?xml version=&#34;1.0&#34; encoding=&#34;utf-8&#34;?&#62; &#60;!-- http://blog.flexexamples.com/2009/10/05/toggling-horizontal-and-vertical-scroll-bars-on-a-spark-list-control-in-flex-4/ --&#62; &#60;s:Application name=&#34;Spark_List_scroller_horizontalScrollPolicy_test&#34; xmlns:fx=&#34;http://ns.adobe.com/mxml/2009&#34; xmlns:s=&#34;library://ns.adobe.com/flex/spark&#34; xmlns:mx=&#34;library://ns.adobe.com/flex/halo&#34;&#62; &#60;s:controlBarContent&#62; &#60;mx:Form styleName=&#34;plain&#34; backgroundAlpha=&#34;0.0&#34;&#62; &#60;mx:FormItem label=&#34;horizontalScrollPolicy:&#34;&#62; &#60;s:ButtonBar id=&#34;hSP&#34; [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can show or hide horizontal and vertical scroll bars on a Spark List control in Flex 4 by setting the <code>horizontalScrollPolicy</code> and/or <code>verticalScrollPolicy</code> styles.</p>
<p>Full code after the jump.</p>
<p><span id="more-2104"></span></p>
<p class="alert">The following example(s) require Flash Player 10 and the Adobe Flex 4 SDK. To download the Adobe Flash Builder 4 trial, see <a href="http://bit.ly/crThlI">http://www.adobe.com/products/flex/</a>. To download the latest nightly build of the Flex 4 SDK, see <a href="http://bit.ly/Flex4SDK">http://opensource.adobe.com/wiki/display/flexsdk/Download+Flex+4</a>.<br/><strong>For more information on getting started with Flex 4 and Flash Builder 4, see the official <a href="http://bit.ly/dCkecm">Adobe Flex Team blog</a>.</strong></p>

<div class="wp_syntax"><div class="code"><pre class="mxml" style="font-family:monospace;"><span style="color: #000000;">&lt;?xml version=<span style="color: #ff0000;">&quot;1.0&quot;</span> encoding=<span style="color: #ff0000;">&quot;utf-8&quot;</span>?<span style="color: #7400FF;">&gt;</span></span>
<span style="color: #000000;"><span style="color: #808080; font-style: italic;">&lt;!-- http://blog.flexexamples.com/2009/10/05/toggling-horizontal-and-vertical-scroll-bars-on-a-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_scroller_horizontalScrollPolicy_test&quot;</span></span>
<span style="color: #000000;">        xmlns:fx=<span style="color: #ff0000;">&quot;http://ns.adobe.com/mxml/2009&quot;</span></span>
<span style="color: #000000;">        xmlns:s=<span style="color: #ff0000;">&quot;library://ns.adobe.com/flex/spark&quot;</span></span>
<span style="color: #000000;">        xmlns:mx=<span style="color: #ff0000;">&quot;library://ns.adobe.com/flex/halo&quot;</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:controlBarContent</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Form</span> styleName=<span style="color: #ff0000;">&quot;plain&quot;</span> backgroundAlpha=<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;mx:FormItem</span> label=<span style="color: #ff0000;">&quot;horizontalScrollPolicy:&quot;</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:ButtonBar</span> id=<span style="color: #ff0000;">&quot;hSP&quot;</span> requireSelection=<span style="color: #ff0000;">&quot;true&quot;</span> change=<span style="color: #ff0000;">&quot;hSP_changeHandler(event);&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;[auto,off,on]&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:ButtonBar</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:FormItem</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:FormItem</span> label=<span style="color: #ff0000;">&quot;verticalScrollPolicy:&quot;</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:ButtonBar</span> id=<span style="color: #ff0000;">&quot;vSP&quot;</span> requireSelection=<span style="color: #ff0000;">&quot;true&quot;</span> change=<span style="color: #ff0000;">&quot;vSP_changeHandler(event);&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;[auto,off,on]&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:ButtonBar</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 spark.events.IndexChangeEvent;</span>
&nbsp;
<span style="color: #000000;">            protected function hSP_changeHandler<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;">                lst.scroller.setStyle<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;horizontalScrollPolicy&quot;</span>, hSP.selectedItem<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 vSP_changeHandler<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;">                lst.scroller.setStyle<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;verticalScrollPolicy&quot;</span>, vSP.selectedItem<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;">            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> gap=<span style="color: #ff0000;">&quot;0&quot;</span></span>
<span style="color: #000000;">                    horizontalAlign=<span style="color: #ff0000;">&quot;contentJustify&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><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> label=<span style="color: #ff0000;">&quot;1. One&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> label=<span style="color: #ff0000;">&quot;2. Two&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> label=<span style="color: #ff0000;">&quot;3. Three&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> label=<span style="color: #ff0000;">&quot;4. Four&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> label=<span style="color: #ff0000;">&quot;5. Five&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> label=<span style="color: #ff0000;">&quot;6. Six&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> label=<span style="color: #ff0000;">&quot;7. Seven&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> label=<span style="color: #ff0000;">&quot;8. Eight&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> label=<span style="color: #ff0000;">&quot;9. Nine&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> label=<span style="color: #ff0000;">&quot;10. 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:ArrayList</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>You can also set the <code>horizontalScrollPolicy</code> and <code>verticalScrollPolicy</code> using advanced CSS, as seen in the following example:</p>

<div class="wp_syntax"><div class="code"><pre class="mxml" style="font-family:monospace;"><span style="color: #000000;">&lt;?xml version=<span style="color: #ff0000;">&quot;1.0&quot;</span> encoding=<span style="color: #ff0000;">&quot;utf-8&quot;</span>?<span style="color: #7400FF;">&gt;</span></span>
<span style="color: #000000;"><span style="color: #808080; font-style: italic;">&lt;!-- http://blog.flexexamples.com/2009/10/05/toggling-horizontal-and-vertical-scroll-bars-on-a-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_scroller_horizontalScrollPolicy_test&quot;</span></span>
<span style="color: #000000;">        xmlns:fx=<span style="color: #ff0000;">&quot;http://ns.adobe.com/mxml/2009&quot;</span></span>
<span style="color: #000000;">        xmlns:s=<span style="color: #ff0000;">&quot;library://ns.adobe.com/flex/spark&quot;</span></span>
<span style="color: #000000;">        xmlns:mx=<span style="color: #ff0000;">&quot;library://ns.adobe.com/flex/halo&quot;</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Style</span><span style="color: #7400FF;">&gt;</span></span>
        @namespace s &quot;library://ns.adobe.com/flex/spark&quot;;
        @namespace mx &quot;library://ns.adobe.com/flex/halo&quot;;
&nbsp;
        s|List#lst s|Scroller {
            horizontalScrollPolicy: off;
            verticalScrollPolicy: off;
        }
    <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:List</span> id=<span style="color: #ff0000;">&quot;lst&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> gap=<span style="color: #ff0000;">&quot;0&quot;</span></span>
<span style="color: #000000;">                    horizontalAlign=<span style="color: #ff0000;">&quot;contentJustify&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><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> label=<span style="color: #ff0000;">&quot;1. One&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> label=<span style="color: #ff0000;">&quot;2. Two&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> label=<span style="color: #ff0000;">&quot;3. Three&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> label=<span style="color: #ff0000;">&quot;4. Four&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> label=<span style="color: #ff0000;">&quot;5. Five&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> label=<span style="color: #ff0000;">&quot;6. Six&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> label=<span style="color: #ff0000;">&quot;7. Seven&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> label=<span style="color: #ff0000;">&quot;8. Eight&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> label=<span style="color: #ff0000;">&quot;9. Nine&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Object</span> label=<span style="color: #ff0000;">&quot;10. 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:ArrayList</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 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: 'Toggling horizontal and vertical scroll bars on a Spark List control in Flex 4 on FlexExamples.com',url: 'http://blog.flexexamples.com/2009/10/05/toggling-horizontal-and-vertical-scroll-bars-on-a-spark-list-control-in-flex-4/',contentID: 'post-2104',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'Gumbo,horizontalScrollPolicy,scroller,verticalScrollPolicy',providerName: 'FlexExamples.com',styling: 'text' });return false" class="evernoteSiteMemoryLink"><img src="http://static.evernote.com/article-clipper-remember.png" class="evernoteSiteMemoryButton" />
				</a>				<div class="evernoteSiteMemoryClear">&nbsp;</div>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.flexexamples.com/2009/10/05/toggling-horizontal-and-vertical-scroll-bars-on-a-spark-list-control-in-flex-4/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Setting the horizontal scrollbar policy on a DataGrid control in Flex</title>
		<link>http://blog.flexexamples.com/2008/08/27/setting-the-horizontal-scrollbar-policy-on-a-datagrid-control-in-flex/</link>
		<comments>http://blog.flexexamples.com/2008/08/27/setting-the-horizontal-scrollbar-policy-on-a-datagrid-control-in-flex/#comments</comments>
		<pubDate>Thu, 28 Aug 2008 05:55:02 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[DataGrid]]></category>
		<category><![CDATA[horizontalScrollPolicy]]></category>
		<category><![CDATA[ScrollPolicy]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2008/08/27/setting-the-horizontal-scrollbar-policy-on-a-datagrid-control-in-flex/</guid>
		<description><![CDATA[<p>The following example shows how you can set the horizontal scrollbar policy on a Flex DataGrid control by setting the horizontalScrollPolicy property to one of the constants in the mx.core.ScrollPolicy class.</p> <p>Full code after the jump.</p> <p></p> <p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/DataGrid_horizontalScrollPolicy_test/bin/srcview/source/main.mxml.html">View MXML</a></p> &#60;?xml version="1.0" encoding="utf-8"?&#62; &#60;!-- http://blog.flexexamples.com/2008/08/27/setting-the-horizontal-scrollbar-policy-on-a-datagrid-control-in-flex/ --&#62; &#60;mx:Application name="DataGrid_horizontalScrollPolicy_test" xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" verticalAlign="middle" backgroundColor="white"&#62; &#60;mx:Script&#62; &#60;![CDATA[ [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can set the horizontal scrollbar policy on a Flex DataGrid control by setting the <code>horizontalScrollPolicy</code> property to one of the constants in the mx.core.ScrollPolicy class.</p>
<p>Full code after the jump.</p>
<p><span id="more-774"></span></p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/DataGrid_horizontalScrollPolicy_test/bin/srcview/source/main.mxml.html">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2008/08/27/setting-the-horizontal-scrollbar-policy-on-a-datagrid-control-in-flex/ --&gt;
&lt;mx:Application name="DataGrid_horizontalScrollPolicy_test"
        xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"&gt;

    &lt;mx:Script&gt;
        &lt;![CDATA[
            import mx.core.ScrollPolicy;
        ]]&gt;
    &lt;/mx:Script&gt;

    &lt;mx:XML id="xmlDP" source="data/dp.xml" /&gt;

    &lt;mx:Array id="arr"&gt;
        &lt;mx:String&gt;{ScrollPolicy.AUTO}&lt;/mx:String&gt;
        &lt;mx:String&gt;{ScrollPolicy.OFF}&lt;/mx:String&gt;
        &lt;mx:String&gt;{ScrollPolicy.ON}&lt;/mx:String&gt;
    &lt;/mx:Array&gt;

    &lt;mx:ApplicationControlBar dock="true"&gt;
        &lt;mx:Form styleName="plain"&gt;
            &lt;mx:FormItem label="horizontalScrollPolicy:"&gt;
                &lt;mx:ComboBox id="comboBox"
                        dataProvider="{arr}" /&gt;
            &lt;/mx:FormItem&gt;
        &lt;/mx:Form&gt;
        &lt;mx:Spacer width="100%" /&gt;
        &lt;mx:Button label="Set dataProvider"
                click="dataGrid.dataProvider = xmlDP.row;" /&gt;
        &lt;mx:Button label="Clear dataProvider"
                click="dataGrid.dataProvider = [];" /&gt;
    &lt;/mx:ApplicationControlBar&gt;

    &lt;mx:DataGrid id="dataGrid"
            horizontalScrollPolicy="{comboBox.selectedItem}"
            width="100%"
            height="100%" /&gt;

&lt;/mx:Application&gt;
</pre>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/DataGrid_horizontalScrollPolicy_test/bin/srcview/index.html">View source</a> is enabled in the following example.</p>
<p><iframe src="http://blog.flexexamples.com/wp-content/uploads/DataGrid_horizontalScrollPolicy_test/bin/main.html" width="100%" height="250"></iframe></p>
<p>You can also set the <code>horizontalScrollPolicy</code> property using ActionScript, as seen in the following example:</p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/DataGrid_horizontalScrollPolicy_test/bin/srcview/source/main2.mxml.html">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2008/08/27/setting-the-horizontal-scrollbar-policy-on-a-datagrid-control-in-flex/ --&gt;
&lt;mx:Application name="DataGrid_horizontalScrollPolicy_test"
        xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"&gt;

    &lt;mx:Script&gt;
        &lt;![CDATA[
            import mx.events.ListEvent;
            import mx.core.ScrollPolicy;

            private function comboBox_change(evt:ListEvent):void {
                var value:String = comboBox.selectedItem.toString();
                dataGrid.horizontalScrollPolicy = value;
            }
        ]]&gt;
    &lt;/mx:Script&gt;

    &lt;mx:XML id="xmlDP" source="data/dp.xml" /&gt;

    &lt;mx:Array id="arr"&gt;
        &lt;mx:String&gt;{ScrollPolicy.AUTO}&lt;/mx:String&gt;
        &lt;mx:String&gt;{ScrollPolicy.OFF}&lt;/mx:String&gt;
        &lt;mx:String&gt;{ScrollPolicy.ON}&lt;/mx:String&gt;
    &lt;/mx:Array&gt;

    &lt;mx:ApplicationControlBar dock="true"&gt;
        &lt;mx:Form styleName="plain"&gt;
            &lt;mx:FormItem label="horizontalScrollPolicy:"&gt;
                &lt;mx:ComboBox id="comboBox"
                        dataProvider="{arr}"
                        selectedIndex="1"
                        change="comboBox_change(event);" /&gt;
            &lt;/mx:FormItem&gt;
        &lt;/mx:Form&gt;
        &lt;mx:Spacer width="100%" /&gt;
        &lt;mx:Button label="Set dataProvider"
                click="dataGrid.dataProvider = xmlDP.row;" /&gt;
        &lt;mx:Button label="Clear dataProvider"
                click="dataGrid.dataProvider = [];" /&gt;
    &lt;/mx:ApplicationControlBar&gt;

    &lt;mx:DataGrid id="dataGrid"
            horizontalScrollPolicy="off"
            width="100%"
            height="100%" /&gt;

&lt;/mx:Application&gt;
</pre>
<p>Due to popular demand, here is the &#8220;same&#8221; example in a more ActionScript friendly format:</p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/DataGrid_horizontalScrollPolicy_test/bin/srcview/source/main3.mxml.html">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2008/08/27/setting-the-horizontal-scrollbar-policy-on-a-datagrid-control-in-flex/ --&gt;
&lt;mx:Application name="DataGrid_horizontalScrollPolicy_test"
        xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"
        initialize="init();"&gt;

    &lt;mx:Script&gt;
        &lt;![CDATA[
            import mx.core.ScrollPolicy;
            import mx.containers.ApplicationControlBar;
            import mx.containers.Form;
            import mx.containers.FormItem;
            import mx.controls.Button;
            import mx.controls.ComboBox;
            import mx.controls.DataGrid;
            import mx.controls.Spacer;
            import mx.events.ListEvent;

            private var arr:Array;
            private var comboBox:ComboBox;
            private var setBtn:Button;
            private var clrBtn:Button;
            private var dataGrid:DataGrid;

            private function init():void {
                arr = [];
                arr.push(ScrollPolicy.AUTO);
                arr.push(ScrollPolicy.OFF);
                arr.push(ScrollPolicy.ON);

                comboBox = new ComboBox();
                comboBox.dataProvider = arr;
                comboBox.addEventListener(ListEvent.CHANGE, comboBox_change);

                setBtn = new Button();
                setBtn.label = "Set dataProvider";
                setBtn.addEventListener(MouseEvent.CLICK, setBtn_click);

                clrBtn = new Button();
                clrBtn.label = "Clear dataProvider";
                clrBtn.addEventListener(MouseEvent.CLICK, clrBtn_click);

                var spacer:Spacer = new Spacer();
                spacer.percentWidth = 100;

                var formItem:FormItem = new FormItem();
                formItem.label = "horizontalScrollPolicy:";
                formItem.addChild(comboBox);

                var form:Form = new Form();
                form.styleName = "plain";
                form.addChild(formItem);

                var appControlBar:ApplicationControlBar;
                appControlBar = new ApplicationControlBar();
                appControlBar.dock = true;
                appControlBar.addChild(form);
                appControlBar.addChild(spacer);
                appControlBar.addChild(setBtn);
                appControlBar.addChild(clrBtn);
                addChildAt(appControlBar, 0);

                dataGrid = new DataGrid();
                dataGrid.percentWidth = 100;
                dataGrid.percentHeight = 100;
                addChild(dataGrid);
            }

            private function comboBox_change(evt:ListEvent):void {
                var value:String = comboBox.selectedItem.toString();
                dataGrid.horizontalScrollPolicy = value;
            }

            private function setBtn_click(evt:MouseEvent):void {
                dataGrid.dataProvider = xmlDP.row;
            }

            private function clrBtn_click(evt:MouseEvent):void {
                dataGrid.dataProvider = [];
            }
        ]]&gt;
    &lt;/mx:Script&gt;

    &lt;mx:XML id="xmlDP" source="data/dp.xml" /&gt;

&lt;/mx:Application&gt;
</pre>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Setting the horizontal scrollbar policy on a DataGrid control in Flex on FlexExamples.com',url: 'http://blog.flexexamples.com/2008/08/27/setting-the-horizontal-scrollbar-policy-on-a-datagrid-control-in-flex/',contentID: 'post-774',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'horizontalScrollPolicy,ScrollPolicy',providerName: 'FlexExamples.com',styling: 'text' });return false" class="evernoteSiteMemoryLink"><img src="http://static.evernote.com/article-clipper-remember.png" class="evernoteSiteMemoryButton" />
				</a>				<div class="evernoteSiteMemoryClear">&nbsp;</div>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.flexexamples.com/2008/08/27/setting-the-horizontal-scrollbar-policy-on-a-datagrid-control-in-flex/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>Scrolling a Flex List control horizontally</title>
		<link>http://blog.flexexamples.com/2008/01/26/scrolling-a-flex-list-control-horizontally/</link>
		<comments>http://blog.flexexamples.com/2008/01/26/scrolling-a-flex-list-control-horizontally/#comments</comments>
		<pubDate>Sat, 26 Jan 2008 22:22:54 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[List]]></category>
		<category><![CDATA[columnWidth]]></category>
		<category><![CDATA[horizontalScrollPolicy]]></category>
		<category><![CDATA[maxHorizontalScrollPosition]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2008/01/26/scrolling-a-flex-list-control-horizontally/</guid>
		<description><![CDATA[<p>The following example shows you how you can create a horizontally scrolling List control in Flex by setting the horizontalScrollPolicy property.</p> <p>Full code after the jump.</p> <p></p> <p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/List_horizontalScrollPolicy_test/main.mxml">View MXML</a></p> &#60;?xml version="1.0" encoding="utf-8"?&#62; &#60;!-- http://blog.flexexamples.com/2008/01/26/scrolling-a-flex-list-control-horizontally/ --&#62; &#60;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" verticalAlign="middle" backgroundColor="white"&#62; &#60;mx:XML id="xmlDP"&#62; &#60;root&#62; &#60;node&#62;Lorem ipsum dolor sit amet, consectetuer adipiscing elit.&#60;/node&#62; &#60;node&#62;Donec sit [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows you how you can create a horizontally scrolling List control in Flex by setting the <code>horizontalScrollPolicy</code> property.</p>
<p>Full code after the jump.</p>
<p><span id="more-482"></span></p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/List_horizontalScrollPolicy_test/main.mxml">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2008/01/26/scrolling-a-flex-list-control-horizontally/ --&gt;
&lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"&gt;

    &lt;mx:XML id="xmlDP"&gt;
        &lt;root&gt;
            &lt;node&gt;Lorem ipsum dolor sit amet, consectetuer adipiscing elit.&lt;/node&gt;
            &lt;node&gt;Donec sit amet dui nec pede aliquam auctor.&lt;/node&gt;
            &lt;node&gt;Integer vestibulum sodales dui.&lt;/node&gt;
            &lt;node&gt;Sed nonummy ligula et tortor.&lt;/node&gt;
            &lt;node&gt;Aenean varius neque vel felis.&lt;/node&gt;
            &lt;node&gt;Phasellus venenatis ipsum sit amet nisi.&lt;/node&gt;
            &lt;node&gt;Nullam vitae turpis et ipsum cursus venenatis.&lt;/node&gt;
            &lt;node&gt;Pellentesque tincidunt pede non arcu.&lt;/node&gt;
            &lt;node&gt;Aliquam ut massa quis ante dignissim egestas.&lt;/node&gt;
            &lt;node&gt;Curabitur facilisis velit sit amet metus.&lt;/node&gt;
            &lt;node&gt;Vivamus ornare massa ac massa.&lt;/node&gt;
            &lt;node&gt;Nam accumsan rutrum purus.&lt;/node&gt;
        &lt;/root&gt;
    &lt;/mx:XML&gt;

    &lt;mx:List id="list"
            dataProvider="{xmlDP.node}"
            horizontalScrollPolicy="on"
            verticalScrollPolicy="auto"
            rowCount="6"
            width="200" /&gt;

&lt;/mx:Application&gt;
</pre>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/List_horizontalScrollPolicy_test/bin/srcview/index.html">View source</a> is enabled in the following example.</p>
<p><iframe src="http://blog.flexexamples.com/wp-content/uploads/List_horizontalScrollPolicy_test/bin/main.html" width="100%" height="220"></iframe></p>
<p>Great taste! Less filling!<br />
But there is one &#8220;gotcha&#8221;. If your List control is small (say, 100 pixels wide) and your text is long (say, 400 pixels wide), the List may not scroll all the way to the end of the text. The solution? Set the <code>maxHorizontalScrollPosition</code> property. (Thanks to Ella for the tip!)</p>
<p>Consider the following example. In this example we have two List controls. The List control on the left sets its width to 150 pixels, whereas the List control on the right sets its width to 150 pixels and uses the <code>creationComplete</code> event to call a function which sets the <code>maxHorizontalScrollPosition</code> property to the value of the list&#8217;s <code>columnWidth</code> property.</p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/List_horizontalScrollPolicy_test_2/main.mxml">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2008/01/26/scrolling-a-flex-list-control-horizontally/ --&gt;
&lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="horizontal"
        verticalAlign="middle"
        backgroundColor="white"&gt;

    &lt;mx:Script&gt;
        &lt;![CDATA[
            private function init():void {
                list2.maxHorizontalScrollPosition = list2.columnWidth;
            }
        ]]&gt;
    &lt;/mx:Script&gt;

    &lt;mx:XML id="xmlDP"&gt;
        &lt;root&gt;
            &lt;node&gt;Lorem ipsum dolor sit amet, consectetuer adipiscing elit.&lt;/node&gt;
            &lt;node&gt;Donec sit amet dui nec pede aliquam auctor.&lt;/node&gt;
            &lt;node&gt;Integer vestibulum sodales dui.&lt;/node&gt;
            &lt;node&gt;Sed nonummy ligula et tortor.&lt;/node&gt;
            &lt;node&gt;Aenean varius neque vel felis.&lt;/node&gt;
            &lt;node&gt;Phasellus venenatis ipsum sit amet nisi.&lt;/node&gt;
            &lt;node&gt;Nullam vitae turpis et ipsum cursus venenatis.&lt;/node&gt;
            &lt;node&gt;Pellentesque tincidunt pede non arcu.&lt;/node&gt;
            &lt;node&gt;Aliquam ut massa quis ante dignissim egestas.&lt;/node&gt;
            &lt;node&gt;Curabitur facilisis velit sit amet metus.&lt;/node&gt;
            &lt;node&gt;Vivamus ornare massa ac massa.&lt;/node&gt;
            &lt;node&gt;Nam accumsan rutrum purus.&lt;/node&gt;
        &lt;/root&gt;
    &lt;/mx:XML&gt;

    &lt;mx:List id="list1"
            dataProvider="{xmlDP.node}"
            horizontalScrollPolicy="on"
            verticalScrollPolicy="on"
            rowCount="6"
            width="150" /&gt;

    &lt;mx:List id="list2"
            dataProvider="{xmlDP.node}"
            horizontalScrollPolicy="on"
            verticalScrollPolicy="on"
            rowCount="6"
            width="150"
            creationComplete="init();" /&gt;

&lt;/mx:Application&gt;
</pre>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/List_horizontalScrollPolicy_test_2/bin/srcview/index.html">View source</a> is enabled in the following example.</p>
<p><iframe src="http://blog.flexexamples.com/wp-content/uploads/List_horizontalScrollPolicy_test_2/bin/main.html" width="100%" height="220"></iframe></p>
<p class="construction">While this technique of setting the <code>maxHorizontalScrollPosition</code> property to the <code>columnWidth</code> property seems to work in this instance, I&#8217;ve only done very limited testing. I haven&#8217;t tested in all cases such as if you load strings from external files or web services, or if your List has long strings which aren&#8217;t currently visible in the list&#8217;s view. You may have to do some tweaking to get this working in your particular circumstance.</p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Scrolling a Flex List control horizontally on FlexExamples.com',url: 'http://blog.flexexamples.com/2008/01/26/scrolling-a-flex-list-control-horizontally/',contentID: 'post-482',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'columnWidth,horizontalScrollPolicy,maxHorizontalScrollPosition',providerName: 'FlexExamples.com',styling: 'text' });return false" class="evernoteSiteMemoryLink"><img src="http://static.evernote.com/article-clipper-remember.png" class="evernoteSiteMemoryButton" />
				</a>				<div class="evernoteSiteMemoryClear">&nbsp;</div>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.flexexamples.com/2008/01/26/scrolling-a-flex-list-control-horizontally/feed/</wfw:commentRss>
		<slash:comments>29</slash:comments>
		</item>
	</channel>
</rss>

