<?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; maxVerticalScrollPosition</title>
	<atom:link href="http://blog.flexexamples.com/tag/maxverticalscrollposition/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>Creating an auto-scrolling DataGrid control in Flex</title>
		<link>http://blog.flexexamples.com/2009/01/31/creating-an-auto-scrolling-datagrid-control-in-flex/</link>
		<comments>http://blog.flexexamples.com/2009/01/31/creating-an-auto-scrolling-datagrid-control-in-flex/#comments</comments>
		<pubDate>Sun, 01 Feb 2009 02:29:58 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[ArrayCollection]]></category>
		<category><![CDATA[CollectionEvent]]></category>
		<category><![CDATA[DataGrid]]></category>
		<category><![CDATA[collectionChange]]></category>
		<category><![CDATA[maxVerticalScrollPosition]]></category>
		<category><![CDATA[validateNow()]]></category>
		<category><![CDATA[verticalScrollPosition]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2009/01/31/creating-an-auto-scrolling-datagrid-control-in-flex/</guid>
		<description><![CDATA[<p>In a previous example, <a href="http://blog.flexexamples.com/2008/11/27/auto-scrolling-a-textarea-control-in-flex/">&#8220;Auto-scrolling a TextArea control in Flex&#8221;</a>, we saw how you can auto-scroll a Flex TextArea control when new content is added by setting the verticalScrollPosition property to the value of the maxVerticalScrollPosition property.</p> <p>The following example shows how you can auto-scroll a Flex DataGrid control using the ArrayCollection object&#8217;s collectionChange [...]]]></description>
			<content:encoded><![CDATA[<p>In a previous example, <a href="http://blog.flexexamples.com/2008/11/27/auto-scrolling-a-textarea-control-in-flex/">&#8220;Auto-scrolling a TextArea control in Flex&#8221;</a>, we saw how you can auto-scroll a Flex TextArea control when new content is added by setting the <code>verticalScrollPosition</code> property to the value of the <code>maxVerticalScrollPosition</code> property.</p>
<p>The following example shows how you can auto-scroll a Flex DataGrid control using the ArrayCollection object&#8217;s <code>collectionChange</code> event, and the <code>verticalScrollPosition</code> and <code>maxVerticalScrollPosition</code> properties.</p>
<p><span id="more-949"></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/2009/01/31/creating-an-auto-scrolling-datagrid-control-in-flex/ --&gt;</span></span>
<span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Application</span> name=<span style="color: #ff0000;">&quot;DataGrid_maxVerticalScrollPosition_text&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;">        backgroundColor=<span style="color: #ff0000;">&quot;white&quot;</span></span>
<span style="color: #000000;">        creationComplete=<span style="color: #ff0000;">&quot;init();&quot;</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #339933;">&lt;mx:Script&gt;</span>
<span style="color: #339933;">        &lt;![CDATA[</span>
<span style="color: #339933;">            import mx.events.CollectionEvent;</span>
<span style="color: #339933;">            private var timer:Timer;</span>
&nbsp;
<span style="color: #339933;">            private function init():void {</span>
<span style="color: #339933;">                timer = new Timer(500);</span>
<span style="color: #339933;">                timer.addEventListener(TimerEvent.TIMER, onTimer);</span>
<span style="color: #339933;">                timer.start();</span>
<span style="color: #339933;">            }</span>
&nbsp;
<span style="color: #339933;">            private function onTimer(evt:TimerEvent):void {</span>
<span style="color: #339933;">                var now:String = new Date().toTimeString();</span>
<span style="color: #339933;">                arrColl.addItem({id:timer.currentCount, time:now});</span>
<span style="color: #339933;">            }</span>
&nbsp;
<span style="color: #339933;">            private function arrColl_collectionChange(evt:CollectionEvent):void {</span>
<span style="color: #339933;">                callLater(autoScrollDataGrid);</span>
<span style="color: #339933;">            }</span>
&nbsp;
<span style="color: #339933;">            private function autoScrollDataGrid():void {</span>
<span style="color: #339933;">                if (dataGrid) {</span>
<span style="color: #339933;">                    dataGrid.validateNow();</span>
<span style="color: #339933;">                    dataGrid.verticalScrollPosition = dataGrid.maxVerticalScrollPosition;</span>
<span style="color: #339933;">                }</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:ArrayCollection</span> id=<span style="color: #ff0000;">&quot;arrColl&quot;</span></span>
<span style="color: #000000;">            collectionChange=<span style="color: #ff0000;">&quot;arrColl_collectionChange(event);&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:DataGrid</span> id=<span style="color: #ff0000;">&quot;dataGrid&quot;</span></span>
<span style="color: #000000;">            dataProvider=<span style="color: #ff0000;">&quot;{arrColl}&quot;</span></span>
<span style="color: #000000;">            verticalScrollPolicy=<span style="color: #ff0000;">&quot;on&quot;</span></span>
<span style="color: #000000;">            width=<span style="color: #ff0000;">&quot;200&quot;</span></span>
<span style="color: #000000;">            rowCount=<span style="color: #ff0000;">&quot;8&quot;</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:columns</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:DataGridColumn</span> dataField=<span style="color: #ff0000;">&quot;id&quot;</span> width=<span style="color: #ff0000;">&quot;50&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:DataGridColumn</span> dataField=<span style="color: #ff0000;">&quot;time&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:columns</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:DataGrid</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
<span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:Application</span><span style="color: #7400FF;">&gt;</span></span></pre></div></div>

<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/DataGrid_maxVerticalScrollPosition_text/bin/srcview/">View source</a> is enabled in the following example.</p>
<p><iframe src="http://blog.flexexamples.com/wp-content/uploads/DataGrid_maxVerticalScrollPosition_text/bin/main.html" width="100%" height="260"></iframe></p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Creating an auto-scrolling DataGrid control in Flex on FlexExamples.com',url: 'http://blog.flexexamples.com/2009/01/31/creating-an-auto-scrolling-datagrid-control-in-flex/',contentID: 'post-949',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'collectionChange,maxVerticalScrollPosition,validateNow(),verticalScrollPosition',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/01/31/creating-an-auto-scrolling-datagrid-control-in-flex/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>Auto-scrolling a TextArea control in Flex</title>
		<link>http://blog.flexexamples.com/2008/11/27/auto-scrolling-a-textarea-control-in-flex/</link>
		<comments>http://blog.flexexamples.com/2008/11/27/auto-scrolling-a-textarea-control-in-flex/#comments</comments>
		<pubDate>Thu, 27 Nov 2008 22:26:54 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[TextArea]]></category>
		<category><![CDATA[callLater()]]></category>
		<category><![CDATA[maxVerticalScrollPosition]]></category>
		<category><![CDATA[validateNow()]]></category>
		<category><![CDATA[verticalScrollPosition]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2008/11/27/auto-scrolling-a-textarea-control-in-flex/</guid>
		<description><![CDATA[<p>The following example shows how you can auto-scroll a Flex TextArea control when new content is added by setting the verticalScrollPosition property to the value of the maxVerticalScrollPosition property.</p> <p>Full code after the jump.</p> <p></p> <p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/TextArea_maxVerticalScrollPosition_text/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/11/27/auto-scrolling-a-textarea-control-in-flex/ --&#62; &#60;mx:Application name="TextArea_maxVerticalScrollPosition_text" xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" verticalAlign="middle" backgroundColor="white" creationComplete="init();"&#62; &#60;mx:Script&#62; &#60;![CDATA[ private [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can auto-scroll a Flex TextArea control when new content is added by setting the <code>verticalScrollPosition</code> property to the value of the <code>maxVerticalScrollPosition</code> property.</p>
<p>Full code after the jump.</p>
<p><span id="more-879"></span></p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/TextArea_maxVerticalScrollPosition_text/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/11/27/auto-scrolling-a-textarea-control-in-flex/ --&gt;
&lt;mx:Application name="TextArea_maxVerticalScrollPosition_text"
        xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"
        creationComplete="init();"&gt;

    &lt;mx:Script&gt;
        &lt;![CDATA[
            private var timer:Timer;

            private function init():void {
                timer = new Timer(500);
                timer.addEventListener(TimerEvent.TIMER, onTimer);
                timer.start();
            }

            private function onTimer(evt:TimerEvent):void {
                var now:String = new Date().toTimeString();
                var str:String = "[" + timer.currentCount + "] " + now;
                textArea.text += str + "\\n";
                textArea.validateNow();
                textArea.verticalScrollPosition = textArea.maxVerticalScrollPosition;
            }
        ]]&gt;
    &lt;/mx:Script&gt;

    &lt;mx:TextArea id="textArea"
            width="200"
            height="160" /&gt;

&lt;/mx:Application&gt;
</pre>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/TextArea_maxVerticalScrollPosition_text/bin/srcview/index.html">View source</a> is enabled in the following example.</p>
<p><iframe src="http://blog.flexexamples.com/wp-content/uploads/TextArea_maxVerticalScrollPosition_text/bin/main.html" width="100%" height="220"></iframe></p>
<p>Or, instead of calling the <code>validateNow()</code> method before using the <code>verticalScrollPosition</code> and <code>maxVerticalScrollPosition</code> properties, you could use the <code>callLater()</code> method to handle the scrolling, as seen in the following example:</p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/TextArea_maxVerticalScrollPosition_text/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/11/27/auto-scrolling-a-textarea-control-in-flex/ --&gt;
&lt;mx:Application name="TextArea_maxVerticalScrollPosition_text"
        xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"
        creationComplete="init();"&gt;

    &lt;mx:Script&gt;
        &lt;![CDATA[
            private var timer:Timer;

            private function init():void {
                timer = new Timer(500);
                timer.addEventListener(TimerEvent.TIMER, onTimer);
                timer.start();
            }

            private function onTimer(evt:TimerEvent):void {
                var now:String = new Date().toTimeString();
                var str:String = "[" + timer.currentCount + "] " + now;
                textArea.text += str + "\\n";
                callLater(autoScrollTextArea, [textArea]);
            }

            private function autoScrollTextArea(target:TextArea):void {
                target.verticalScrollPosition = target.maxVerticalScrollPosition;
            }
        ]]&gt;
    &lt;/mx:Script&gt;

    &lt;mx:TextArea id="textArea"
            width="200"
            height="160" /&gt;

&lt;/mx:Application&gt;
</pre>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Auto-scrolling a TextArea control in Flex on FlexExamples.com',url: 'http://blog.flexexamples.com/2008/11/27/auto-scrolling-a-textarea-control-in-flex/',contentID: 'post-879',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'callLater(),maxVerticalScrollPosition,validateNow(),verticalScrollPosition',providerName: 'FlexExamples.com',styling: 'text' });return false" class="evernoteSiteMemoryLink"><img src="http://static.evernote.com/article-clipper-remember.png" class="evernoteSiteMemoryButton" />
				</a>				<div class="evernoteSiteMemoryClear">&nbsp;</div>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.flexexamples.com/2008/11/27/auto-scrolling-a-textarea-control-in-flex/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Programmatically scrolling a TextArea control in Flex</title>
		<link>http://blog.flexexamples.com/2008/08/26/programmatically-scrolling-a-textarea-control-in-flex/</link>
		<comments>http://blog.flexexamples.com/2008/08/26/programmatically-scrolling-a-textarea-control-in-flex/#comments</comments>
		<pubDate>Tue, 26 Aug 2008 07:14:17 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[TextArea]]></category>
		<category><![CDATA[maxVerticalScrollPosition]]></category>
		<category><![CDATA[verticalScrollPolicy]]></category>
		<category><![CDATA[verticalScrollPosition]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2008/08/26/programmatically-scrolling-a-textarea-control-in-flex/</guid>
		<description><![CDATA[<p>The following example shows how you can scroll a Flex TextArea control by setting the verticalScrollPosition and maxVerticalScrollPosition properties.</p> <p>Full code after the jump.</p> <p></p> <p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/TextArea_verticalScrollPosition_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/26/programmatically-scrolling-a-textarea-control-in-flex/ --&#62; &#60;mx:Application name="TextArea_verticalScrollPosition_test" xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" verticalAlign="middle" backgroundColor="white" creationComplete="init();"&#62; &#60;mx:Script&#62; &#60;![CDATA[ private function init():void { callLater(setMaxVScrollPos); } private function setMaxVScrollPos():void { slider.maximum [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can scroll a Flex TextArea control by setting the <code>verticalScrollPosition</code> and <code>maxVerticalScrollPosition</code> properties.</p>
<p>Full code after the jump.</p>
<p><span id="more-768"></span></p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/TextArea_verticalScrollPosition_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/26/programmatically-scrolling-a-textarea-control-in-flex/ --&gt;
&lt;mx:Application name="TextArea_verticalScrollPosition_test"
        xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"
        creationComplete="init();"&gt;

    &lt;mx:Script&gt;
        &lt;![CDATA[
            private function init():void {
                callLater(setMaxVScrollPos);
            }

            private function setMaxVScrollPos():void {
                slider.maximum = textArea.maxVerticalScrollPosition;
            }
        ]]&gt;
    &lt;/mx:Script&gt;

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

    &lt;mx:ApplicationControlBar dock="true"&gt;
        &lt;mx:Form styleName="plain"&gt;
            &lt;mx:FormItem label="verticalScrollPosition:"&gt;
                &lt;mx:HSlider id="slider"
                        minimum="0"
                        snapInterval="1"
                        liveDragging="true" /&gt;
            &lt;/mx:FormItem&gt;
        &lt;/mx:Form&gt;
    &lt;/mx:ApplicationControlBar&gt;

    &lt;mx:TextArea id="textArea"
            text="{lorem}"
            verticalScrollPosition="{slider.value}"
            verticalScrollPolicy="on"
            width="100%"
            height="100%"
            resize="init();" /&gt;

&lt;/mx:Application&gt;
</pre>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/TextArea_verticalScrollPosition_test/bin/srcview/index.html">View source</a> is enabled in the following example.</p>
<p><iframe src="http://blog.flexexamples.com/wp-content/uploads/TextArea_verticalScrollPosition_test/bin/main.html" width="100%" height="250"></iframe></p>
<p>You can also set the <code>verticalScrollPosition</code> property using ActionScript, as seen in the following example:</p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/TextArea_verticalScrollPosition_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/26/programmatically-scrolling-a-textarea-control-in-flex/ --&gt;
&lt;mx:Application name="TextArea_verticalScrollPosition_test"
        xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"
        creationComplete="init();"&gt;

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

            private function init():void {
                callLater(setMaxVScrollPos);
            }

            private function setMaxVScrollPos():void {
                slider.maximum = textArea.maxVerticalScrollPosition;
            }

            private function slider_change(evt:SliderEvent):void {
                textArea.verticalScrollPosition = evt.value;
            }
        ]]&gt;
    &lt;/mx:Script&gt;

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

    &lt;mx:ApplicationControlBar dock="true"&gt;
        &lt;mx:Form styleName="plain"&gt;
            &lt;mx:FormItem label="verticalScrollPosition:"&gt;
                &lt;mx:HSlider id="slider"
                        minimum="0"
                        snapInterval="1"
                        liveDragging="true"
                        change="slider_change(event);" /&gt;
            &lt;/mx:FormItem&gt;
        &lt;/mx:Form&gt;
    &lt;/mx:ApplicationControlBar&gt;

    &lt;mx:TextArea id="textArea"
            text="{lorem}"
            verticalScrollPolicy="on"
            width="100%"
            height="100%"
            resize="init();" /&gt;

&lt;/mx:Application&gt;
</pre>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Programmatically scrolling a TextArea control in Flex on FlexExamples.com',url: 'http://blog.flexexamples.com/2008/08/26/programmatically-scrolling-a-textarea-control-in-flex/',contentID: 'post-768',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'maxVerticalScrollPosition,verticalScrollPolicy,verticalScrollPosition',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/26/programmatically-scrolling-a-textarea-control-in-flex/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Setting a Flex container&#8217;s vertical scroll policy</title>
		<link>http://blog.flexexamples.com/2007/11/09/setting-a-flex-containers-vertical-scroll-policy/</link>
		<comments>http://blog.flexexamples.com/2007/11/09/setting-a-flex-containers-vertical-scroll-policy/#comments</comments>
		<pubDate>Sat, 10 Nov 2007 06:51:19 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[VBox]]></category>
		<category><![CDATA[maxVerticalScrollPosition]]></category>
		<category><![CDATA[verticalScrollPolicy]]></category>
		<category><![CDATA[verticalScrollPosition]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2007/11/09/setting-a-flex-containers-vertical-scroll-policy/</guid>
		<description><![CDATA[<p>The following example shows how you can use the verticalScrollPolicy property on a Flex VBox container to control the appearance of the vertical scroll bar when the container&#8217;s contents exceed the dimensions of the container.</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/2007/11/09/setting-a-flex-containers-vertical-scroll-policy/ --&#62; &#60;mx:Application xmlns:mx=&#34;http://www.adobe.com/2006/mxml&#34; layout=&#34;vertical&#34; verticalAlign=&#34;middle&#34; backgroundColor=&#34;white&#34;&#62; &#160; &#60;mx:Script&#62; &#60;![CDATA[ [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can use the <code>verticalScrollPolicy</code> property on a Flex VBox container to control the appearance of the vertical scroll bar when the container&#8217;s contents exceed the dimensions of the container.</p>
<p>Full code after the jump.</p>
<p><span id="more-267"></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/2007/11/09/setting-a-flex-containers-vertical-scroll-policy/ --&gt;</span></span>
<span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Application</span> 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;">        backgroundColor=<span style="color: #ff0000;">&quot;white&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;">            private function updateScrollPosition():void {</span>
<span style="color: #339933;">                vSP.text = vBox.verticalScrollPosition.toString();</span>
<span style="color: #339933;">                mVSP.text = vBox.maxVerticalScrollPosition.toString();</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:Style</span><span style="color: #7400FF;">&gt;</span></span>
        VBox {
            paddingLeft: 10;
            paddingRight: 10;
            paddingTop: 10;
            paddingBottom: 10;
        }
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:Style</span><span style="color: #7400FF;">&gt;</span></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;verticalScrollPolicy:&quot;</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:ComboBox</span> id=<span style="color: #ff0000;">&quot;comboBox&quot;</span><span style="color: #7400FF;">&gt;</span></span>
                    <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:dataProvider</span><span style="color: #7400FF;">&gt;</span></span>
                        <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Array</span><span style="color: #7400FF;">&gt;</span></span>
                            <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Object</span> label=<span style="color: #ff0000;">&quot;auto&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                            <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Object</span> label=<span style="color: #ff0000;">&quot;on&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                            <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Object</span> label=<span style="color: #ff0000;">&quot;off&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:Array</span><span style="color: #7400FF;">&gt;</span></span>
                    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:dataProvider</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:ComboBox</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;height:&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;slider&quot;</span></span>
<span style="color: #000000;">                        minimum=<span style="color: #ff0000;">&quot;50&quot;</span></span>
<span style="color: #000000;">                        maximum=<span style="color: #ff0000;">&quot;300&quot;</span></span>
<span style="color: #000000;">                        value=<span style="color: #ff0000;">&quot;50&quot;</span></span>
<span style="color: #000000;">                        liveDragging=<span style="color: #ff0000;">&quot;true&quot;</span></span>
<span style="color: #000000;">                        snapInterval=<span style="color: #ff0000;">&quot;1&quot;</span></span>
<span style="color: #000000;">                        tickInterval=<span style="color: #ff0000;">&quot;50&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;verticalScrollPosition:&quot;</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Label</span> id=<span style="color: #ff0000;">&quot;vSP&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;maxVerticalScrollPosition:&quot;</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Label</span> id=<span style="color: #ff0000;">&quot;mVSP&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:VBox</span> id=<span style="color: #ff0000;">&quot;vBox&quot;</span></span>
<span style="color: #000000;">            verticalScrollPolicy=<span style="color: #ff0000;">&quot;{comboBox.selectedItem.label}&quot;</span></span>
<span style="color: #000000;">            backgroundColor=<span style="color: #ff0000;">&quot;haloSilver&quot;</span></span>
<span style="color: #000000;">            width=<span style="color: #ff0000;">&quot;200&quot;</span></span>
<span style="color: #000000;">            height=<span style="color: #ff0000;">&quot;200&quot;</span></span>
<span style="color: #000000;">            updateComplete=<span style="color: #ff0000;">&quot;updateScrollPosition();&quot;</span></span>
<span style="color: #000000;">            creationComplete=<span style="color: #ff0000;">&quot;updateScrollPosition();&quot;</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Box</span> id=<span style="color: #ff0000;">&quot;box&quot;</span></span>
<span style="color: #000000;">                backgroundColor=<span style="color: #ff0000;">&quot;haloBlue&quot;</span></span>
<span style="color: #000000;">                width=<span style="color: #ff0000;">&quot;100%&quot;</span></span>
<span style="color: #000000;">                height=<span style="color: #ff0000;">&quot;{slider.value}&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:VBox</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
<span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:Application</span><span style="color: #7400FF;">&gt;</span></span></pre></div></div>

<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/VBox_verticalScrollPolicy_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/VBox_verticalScrollPolicy_test/bin/main.html" width="100%" height="450"></iframe></p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Setting a Flex container\&#039;s vertical scroll policy on FlexExamples.com',url: 'http://blog.flexexamples.com/2007/11/09/setting-a-flex-containers-vertical-scroll-policy/',contentID: 'post-267',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'maxVerticalScrollPosition,verticalScrollPolicy,verticalScrollPosition',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/2007/11/09/setting-a-flex-containers-vertical-scroll-policy/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

