<?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; contentHeight</title>
	<atom:link href="http://blog.flexexamples.com/tag/contentheight/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.flexexamples.com</link>
	<description>Just a bunch of Adobe Flex Examples</description>
	<lastBuildDate>Wed, 26 Jan 2011 18:09:51 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Setting the vertical scroll position on a Spark RichEditableText control in Flex 4</title>
		<link>http://blog.flexexamples.com/2009/08/19/setting-the-vertical-scroll-position-on-a-spark-richeditabletext-control-in-flex-4/</link>
		<comments>http://blog.flexexamples.com/2009/08/19/setting-the-vertical-scroll-position-on-a-spark-richeditabletext-control-in-flex-4/#comments</comments>
		<pubDate>Wed, 19 Aug 2009 14:22:38 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[beta1]]></category>
		<category><![CDATA[RichEditableText]]></category>
		<category><![CDATA[contentHeight]]></category>
		<category><![CDATA[Gumbo]]></category>
		<category><![CDATA[verticalScrollPosition]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/?p=1649</guid>
		<description><![CDATA[<p>The following example shows how you can programatically scroll a Spark RichEditableText control in Flex 4 by setting the verticalScrollPosition property.</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/08/19/setting-the-vertical-scroll-position-on-a-spark-richeditabletext-control-in-flex-4/ --&#62; &#60;s:Application name=&#34;Spark_RichEditableText_verticalScrollPosition_test&#34; xmlns:fx=&#34;http://ns.adobe.com/mxml/2009&#34; xmlns:s=&#34;library://ns.adobe.com/flex/spark&#34; xmlns:mx=&#34;library://ns.adobe.com/flex/halo&#34;&#62; &#160; &#60;mx:ApplicationControlBar width=&#34;100%&#34; cornerRadius=&#34;0&#34;&#62; &#60;mx:Form styleName=&#34;plain&#34;&#62; &#60;mx:FormItem label=&#34;verticalScrollPosition:&#34;&#62; &#60;s:HSlider id=&#34;slider&#34; minimum=&#34;0&#34; maximum=&#34;{richEditableTxt.contentHeight - richEditableTxt.height}&#34; change=&#34;richEditableTxt.verticalScrollPosition = slider.value;&#34; [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can programatically scroll a Spark RichEditableText control in Flex 4 by setting the <code>verticalScrollPosition</code> property.</p>
<p>Full code after the jump.</p>
<p><span id="more-1649"></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/08/19/setting-the-vertical-scroll-position-on-a-spark-richeditabletext-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_RichEditableText_verticalScrollPosition_test&quot;</span></span>
<span style="color: #000000;">        xmlns:fx=<span style="color: #ff0000;">&quot;http://ns.adobe.com/mxml/2009&quot;</span></span>
<span style="color: #000000;">        xmlns:s=<span style="color: #ff0000;">&quot;library://ns.adobe.com/flex/spark&quot;</span></span>
<span style="color: #000000;">        xmlns:mx=<span style="color: #ff0000;">&quot;library://ns.adobe.com/flex/halo&quot;</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:ApplicationControlBar</span> width=<span style="color: #ff0000;">&quot;100%&quot;</span> cornerRadius=<span style="color: #ff0000;">&quot;0&quot;</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Form</span> styleName=<span style="color: #ff0000;">&quot;plain&quot;</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:FormItem</span> label=<span style="color: #ff0000;">&quot;verticalScrollPosition:&quot;</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:HSlider</span> id=<span style="color: #ff0000;">&quot;slider&quot;</span></span>
<span style="color: #000000;">                        minimum=<span style="color: #ff0000;">&quot;0&quot;</span></span>
<span style="color: #000000;">                        maximum=<span style="color: #ff0000;">&quot;{richEditableTxt.contentHeight - richEditableTxt.height}&quot;</span></span>
<span style="color: #000000;">                        change=<span style="color: #ff0000;">&quot;richEditableTxt.verticalScrollPosition = slider.value;&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:FormItem</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:Form</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:ApplicationControlBar</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:RichEditableText</span> id=<span style="color: #ff0000;">&quot;richEditableTxt&quot;</span></span>
<span style="color: #000000;">            widthInChars=<span style="color: #ff0000;">&quot;20&quot;</span></span>
<span style="color: #000000;">            heightInLines=<span style="color: #ff0000;">&quot;10&quot;</span></span>
<span style="color: #000000;">            textAlign=<span style="color: #ff0000;">&quot;justify&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:content</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:p</span><span style="color: #7400FF;">&gt;</span></span>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque tempus, eros ac dignissim interdum, elit sem euismod velit, eget laoreet urna metus nec enim. Cras ornare nulla imperdiet nulla blandit vehicula. Donec risus dolor, sollicitudin nec fringilla nec, aliquet vitae nisl. Duis tincidunt fermentum posuere. Nullam augue sem, rutrum a viverra aliquet, elementum interdum lacus. Aliquam dictum, nulla sit amet tempor commodo, tortor purus ullamcorper turpis, id aliquet dolor mauris vel turpis. Mauris placerat justo non orci porttitor hendrerit. Aenean mattis augue quis turpis dapibus sed eleifend mi sodales. Morbi sem tortor, ultricies vitae laoreet in, viverra id erat. Cras sed varius dolor. Sed vestibulum, sem at vehicula volutpat, enim augue facilisis nunc, ut dapibus nisi mi vel dui. Phasellus elementum leo quis velit mollis aliquam. Fusce a hendrerit lectus. Suspendisse potenti. Nulla urna diam, vulputate sed fringilla eget, consectetur ac risus. Duis sem nisl, hendrerit sit amet volutpat ut, posuere nec diam. Donec dignissim tortor in velit bibendum imperdiet. Sed nibh nulla, fringilla et auctor eu, tincidunt vel arcu.<span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:p</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:p</span><span style="color: #7400FF;">&gt;</span></span>Phasellus egestas nunc et eros accumsan congue ornare nunc vestibulum. In quis erat magna, in mattis purus. Aliquam tempor, velit ac interdum sagittis, nisi neque sodales neque, ac tempus metus leo eget tellus. Cras non gravida tortor. Cras dictum rutrum vehicula. Morbi arcu odio, ultricies quis rhoncus aliquam, consectetur sit amet ligula. In aliquam fermentum mollis. Suspendisse ut massa nibh. Praesent tincidunt, tortor a semper egestas, purus mauris blandit magna, non bibendum leo leo varius odio. Suspendisse aliquet tempor arcu porta posuere.<span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:p</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:content</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:RichEditableText</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 vertical scroll position on a Spark RichEditableText control in Flex 4 on FlexExamples.com',url: 'http://blog.flexexamples.com/2009/08/19/setting-the-vertical-scroll-position-on-a-spark-richeditabletext-control-in-flex-4/',contentID: 'post-1649',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'contentHeight,Gumbo,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/08/19/setting-the-vertical-scroll-position-on-a-spark-richeditabletext-control-in-flex-4/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Setting the vertical scroll position on a Spark List control in Flex 4</title>
		<link>http://blog.flexexamples.com/2009/05/30/setting-the-vertical-scroll-position-on-a-spark-list-control-in-flex-4/</link>
		<comments>http://blog.flexexamples.com/2009/05/30/setting-the-vertical-scroll-position-on-a-spark-list-control-in-flex-4/#comments</comments>
		<pubDate>Sun, 31 May 2009 06:59:23 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[beta2]]></category>
		<category><![CDATA[List (Spark)]]></category>
		<category><![CDATA[VerticalLayout]]></category>
		<category><![CDATA[contentHeight]]></category>
		<category><![CDATA[Gumbo]]></category>
		<category><![CDATA[verticalScrollPosition]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2009/05/30/setting-the-vertical-scroll-position-on-a-spark-list-control-in-flex-4/</guid>
		<description><![CDATA[<p>The following example shows how you can set the vertical scroll position on a Spark List control in Flex 4 by setting the verticalScrollPosition property on the VerticalLayout object.</p> <p></p> &#60;?xml version=&#34;1.0&#34; encoding=&#34;utf-8&#34;?&#62; &#60;!-- http://blog.flexexamples.com/2009/05/30/setting-the-vertical-scroll-position-on-a-spark-list-control-in-flex-4/ --&#62; &#60;s:Application name=&#34;Spark_List_layout_VerticalLayout_verticalScrollPosition_test&#34; xmlns:fx=&#34;http://ns.adobe.com/mxml/2009&#34; xmlns:s=&#34;library://ns.adobe.com/flex/spark&#34; xmlns:mx=&#34;library://ns.adobe.com/flex/mx&#34;&#62; &#60;s:controlBarContent&#62; &#60;mx:Form styleName=&#34;plain&#34;&#62; &#60;mx:FormItem label=&#34;verticalScrollPosition:&#34;&#62; &#60;s:HSlider id=&#34;slider&#34; /&#62; &#60;/mx:FormItem&#62; &#60;/mx:Form&#62; &#60;/s:controlBarContent&#62; &#160; &#60;fx:Script&#62; &#60;!&#91;CDATA&#91; [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can set the vertical scroll position on a Spark List control in Flex 4 by setting the <code>verticalScrollPosition</code> property on the VerticalLayout object.</p>
<p><span id="more-1095"></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/05/30/setting-the-vertical-scroll-position-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_layout_VerticalLayout_verticalScrollPosition_test&quot;</span></span>
<span style="color: #000000;">        xmlns:fx=<span style="color: #ff0000;">&quot;http://ns.adobe.com/mxml/2009&quot;</span></span>
<span style="color: #000000;">        xmlns:s=<span style="color: #ff0000;">&quot;library://ns.adobe.com/flex/spark&quot;</span></span>
<span style="color: #000000;">        xmlns:mx=<span style="color: #ff0000;">&quot;library://ns.adobe.com/flex/mx&quot;</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:controlBarContent</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Form</span> styleName=<span style="color: #ff0000;">&quot;plain&quot;</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:FormItem</span> label=<span style="color: #ff0000;">&quot;verticalScrollPosition:&quot;</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:HSlider</span> id=<span style="color: #ff0000;">&quot;slider&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:FormItem</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:Form</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:controlBarContent</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Script</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;">&lt;!<span style="color: #66cc66;">&#91;</span>CDATA<span style="color: #66cc66;">&#91;</span></span>
<span style="color: #000000;">            import mx.events.FlexEvent;</span>
&nbsp;
<span style="color: #000000;">            protected function list_creationCompleteHandler<span style="color: #66cc66;">&#40;</span>evt:FlexEvent<span style="color: #66cc66;">&#41;</span>:void <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">                slider.maximum = list.dataGroup.contentHeight - list.height;</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;">            horizontalCenter=<span style="color: #ff0000;">&quot;0&quot;</span></span>
<span style="color: #000000;">            verticalCenter=<span style="color: #ff0000;">&quot;0&quot;</span></span>
<span style="color: #000000;">            creationComplete=<span style="color: #ff0000;">&quot;list_creationCompleteHandler(event);&quot;</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:layout</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:VerticalLayout</span> horizontalAlign=<span style="color: #ff0000;">&quot;justify&quot;</span> </span>
<span style="color: #000000;">                    requestedRowCount=<span style="color: #ff0000;">&quot;4&quot;</span></span>
<span style="color: #000000;">                    verticalScrollPosition=<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;/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:String</span><span style="color: #7400FF;">&gt;</span></span>The<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>Quick<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>Brown<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>Fox<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>Jumps<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>Over<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>The<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>Lazy<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>Dog<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: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="information"><a href="http://blog.flexexamples.com/wp-content/uploads/spark/Spark_List_layout_VerticalLayout_verticalScrollPosition_test/bin/srcview/">View source</a> is enabled in the following example.</p>
<p><iframe src="http://blog.flexexamples.com/wp-content/uploads/spark/Spark_List_layout_VerticalLayout_verticalScrollPosition_test/bin/main.html" width="100%" height="300"></iframe></p>
<p>You can also set the <code>verticalScrollPosition</code> property 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/05/30/setting-the-vertical-scroll-position-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_layout_VerticalLayout_verticalScrollPosition_test&quot;</span></span>
<span style="color: #000000;">        xmlns:fx=<span style="color: #ff0000;">&quot;http://ns.adobe.com/mxml/2009&quot;</span></span>
<span style="color: #000000;">        xmlns:s=<span style="color: #ff0000;">&quot;library://ns.adobe.com/flex/spark&quot;</span></span>
<span style="color: #000000;">        xmlns:mx=<span style="color: #ff0000;">&quot;library://ns.adobe.com/flex/mx&quot;</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:controlBarContent</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Form</span> styleName=<span style="color: #ff0000;">&quot;plain&quot;</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:FormItem</span> label=<span style="color: #ff0000;">&quot;verticalScrollPosition:&quot;</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:HSlider</span> id=<span style="color: #ff0000;">&quot;slider&quot;</span></span>
<span style="color: #000000;">                        change=<span style="color: #ff0000;">&quot;slider_changeHandler(event)&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:FormItem</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:Form</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:controlBarContent</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Script</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;">&lt;!<span style="color: #66cc66;">&#91;</span>CDATA<span style="color: #66cc66;">&#91;</span></span>
<span style="color: #000000;">            import mx.events.FlexEvent;</span>
&nbsp;
<span style="color: #000000;">            protected function list_creationCompleteHandler<span style="color: #66cc66;">&#40;</span>evt:FlexEvent<span style="color: #66cc66;">&#41;</span>:void <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">                slider.maximum = list.dataGroup.contentHeight - list.height;</span>
<span style="color: #000000;">            <span style="color: #66cc66;">&#125;</span></span>
&nbsp;
<span style="color: #000000;">            protected function slider_changeHandler<span style="color: #66cc66;">&#40;</span>evt:Event<span style="color: #66cc66;">&#41;</span>:void <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">                list.layout.verticalScrollPosition = slider.value;</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;">            horizontalCenter=<span style="color: #ff0000;">&quot;0&quot;</span></span>
<span style="color: #000000;">            verticalCenter=<span style="color: #ff0000;">&quot;0&quot;</span></span>
<span style="color: #000000;">            creationComplete=<span style="color: #ff0000;">&quot;list_creationCompleteHandler(event);&quot;</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:layout</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:VerticalLayout</span> horizontalAlign=<span style="color: #ff0000;">&quot;justify&quot;</span> </span>
<span style="color: #000000;">                    requestedRowCount=<span style="color: #ff0000;">&quot;4&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:String</span><span style="color: #7400FF;">&gt;</span></span>The<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>Quick<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>Brown<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>Fox<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>Jumps<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>Over<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>The<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>Lazy<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>Dog<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:List</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
<span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:Application</span><span style="color: #7400FF;">&gt;</span></span></pre></div></div>

<p class="alert">This entry is based on a beta version of the Flex 4 SDK and therefore is very likely to change as development of the Flex SDK continues. The API can (and will) change causing examples to possibly not compile in newer versions of the Flex 4 SDK.</p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Setting the vertical scroll position on a Spark List control in Flex 4 on FlexExamples.com',url: 'http://blog.flexexamples.com/2009/05/30/setting-the-vertical-scroll-position-on-a-spark-list-control-in-flex-4/',contentID: 'post-1095',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'contentHeight,Gumbo,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/05/30/setting-the-vertical-scroll-position-on-a-spark-list-control-in-flex-4/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
	</channel>
</rss>

