<?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; VGroup (Spark)</title>
	<atom:link href="http://blog.flexexamples.com/category/spark/vgroup-spark/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>Auto scrolling the contents of a VGroup container in Flex 4</title>
		<link>http://blog.flexexamples.com/2009/11/02/auto-scrolling-the-contents-of-a-vgroup-container-in-flex-4/</link>
		<comments>http://blog.flexexamples.com/2009/11/02/auto-scrolling-the-contents-of-a-vgroup-container-in-flex-4/#comments</comments>
		<pubDate>Mon, 02 Nov 2009 23:50:34 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[AnimateProperties]]></category>
		<category><![CDATA[beta2]]></category>
		<category><![CDATA[Scroller (Spark)]]></category>
		<category><![CDATA[VerticalLayout (Spark)]]></category>
		<category><![CDATA[VGroup (Spark)]]></category>
		<category><![CDATA[fractionOfElementInView()]]></category>
		<category><![CDATA[getElementIndex()]]></category>
		<category><![CDATA[getScrollPositionDeltaToElement()]]></category>
		<category><![CDATA[Gumbo]]></category>
		<category><![CDATA[layout]]></category>
		<category><![CDATA[verticalScrollPosition]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/?p=2136</guid>
		<description><![CDATA[<p>The following example shows how you can tab through a series of Spark TextInput controls in Flex 4 and auto-scroll the VGroup container so that the currently focused text field has focus by using the fractionOfElementInView() method, getScrollPositionDeltaToElement() method, and verticalScrollPosition property.</p> <p>Full code after the jump.</p> <p></p> <p class="note">And a big thanks to <a [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can tab through a series of Spark TextInput controls in Flex 4 and auto-scroll the VGroup container so that the currently focused text field has focus by using the <code>fractionOfElementInView()</code> method, <code>getScrollPositionDeltaToElement()</code> method, and <code>verticalScrollPosition</code> property.</p>
<p>Full code after the jump.</p>
<p><span id="more-2136"></span></p>
<p class="note">And a big thanks to <a href="http://hansmuller-flex.blogspot.com/">Hans Muller</a> for explaining this all to me.</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/02/auto-scrolling-the-contents-of-a-vgroup-container-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_VerticalLayout_getScrollPositionDeltaToElement_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.IVisualElement;</span>
<span style="color: #000000;">            import spark.layouts.VerticalLayout;</span>
&nbsp;
<span style="color: #000000;">            protected function textinput_focusInHandler<span style="color: #66cc66;">&#40;</span>evt:FocusEvent<span style="color: #66cc66;">&#41;</span>:void <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">                var idx:int = vg.getElementIndex<span style="color: #66cc66;">&#40;</span>evt.currentTarget as IVisualElement<span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                var lay:VerticalLayout = vg.layout as VerticalLayout;</span>
<span style="color: #000000;">                if <span style="color: #66cc66;">&#40;</span>lay.fractionOfElementInView<span style="color: #66cc66;">&#40;</span>idx<span style="color: #66cc66;">&#41;</span> &lt; <span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">                    lay.verticalScrollPosition += lay.getScrollPositionDeltaToElement<span style="color: #66cc66;">&#40;</span>idx<span style="color: #66cc66;">&#41;</span>.y;</span>
<span style="color: #000000;">                <span style="color: #66cc66;">&#125;</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:Scroller</span> id=<span style="color: #ff0000;">&quot;scrllr&quot;</span></span>
<span style="color: #000000;">            focusEnabled=<span style="color: #ff0000;">&quot;false&quot;</span></span>
<span style="color: #000000;">            hasFocusableChildren=<span style="color: #ff0000;">&quot;true&quot;</span></span>
<span style="color: #000000;">            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 style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:VGroup</span> id=<span style="color: #ff0000;">&quot;vg&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> paddingTop=<span style="color: #ff0000;">&quot;10&quot;</span> paddingBottom=<span style="color: #ff0000;">&quot;10&quot;</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:TextInput</span> text=<span style="color: #ff0000;">&quot;One&quot;</span> focusIn=<span style="color: #ff0000;">&quot;textinput_focusInHandler(event);&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:TextInput</span> text=<span style="color: #ff0000;">&quot;Two&quot;</span> focusIn=<span style="color: #ff0000;">&quot;textinput_focusInHandler(event);&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:TextInput</span> text=<span style="color: #ff0000;">&quot;Three&quot;</span> focusIn=<span style="color: #ff0000;">&quot;textinput_focusInHandler(event);&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:TextInput</span> text=<span style="color: #ff0000;">&quot;Four&quot;</span> focusIn=<span style="color: #ff0000;">&quot;textinput_focusInHandler(event);&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:TextInput</span> text=<span style="color: #ff0000;">&quot;Five&quot;</span> focusIn=<span style="color: #ff0000;">&quot;textinput_focusInHandler(event);&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:TextInput</span> text=<span style="color: #ff0000;">&quot;Six&quot;</span> focusIn=<span style="color: #ff0000;">&quot;textinput_focusInHandler(event);&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:TextInput</span> text=<span style="color: #ff0000;">&quot;Seven&quot;</span> focusIn=<span style="color: #ff0000;">&quot;textinput_focusInHandler(event);&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:TextInput</span> text=<span style="color: #ff0000;">&quot;Eight&quot;</span> focusIn=<span style="color: #ff0000;">&quot;textinput_focusInHandler(event);&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:TextInput</span> text=<span style="color: #ff0000;">&quot;Nine&quot;</span> focusIn=<span style="color: #ff0000;">&quot;textinput_focusInHandler(event);&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:VGroup</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:Scroller</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
<span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:Application</span><span style="color: #7400FF;">&gt;</span></span></pre></div></div>

<p>If you wanted to add a little scrolling animation (&#8217;cause who <em>DOESN&#8217;T</em> love animation!?), you could use an Animate with a SimpleMotionPath, 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/02/auto-scrolling-the-contents-of-a-vgroup-container-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_VerticalLayout_getScrollPositionDeltaToElement_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.IVisualElement;</span>
<span style="color: #000000;">            import spark.layouts.VerticalLayout;</span>
&nbsp;
<span style="color: #000000;">            protected function textinput_focusInHandler<span style="color: #66cc66;">&#40;</span>evt:FocusEvent<span style="color: #66cc66;">&#41;</span>:void <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">                var idx:int = vg.getElementIndex<span style="color: #66cc66;">&#40;</span>evt.currentTarget as IVisualElement<span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                var lay:VerticalLayout = vg.layout as VerticalLayout;</span>
<span style="color: #000000;">                if <span style="color: #66cc66;">&#40;</span>lay.fractionOfElementInView<span style="color: #66cc66;">&#40;</span>idx<span style="color: #66cc66;">&#41;</span> &lt; <span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">                    pth.valueBy = lay.getScrollPositionDeltaToElement<span style="color: #66cc66;">&#40;</span>idx<span style="color: #66cc66;">&#41;</span>.y;</span>
<span style="color: #000000;">                    anim.play<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#91;</span>lay<span style="color: #66cc66;">&#93;</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;">&#125;</span></span>
<span style="color: #000000;">        <span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#93;</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/fx:Script</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Declarations</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Animate</span> id=<span style="color: #ff0000;">&quot;anim&quot;</span> duration=<span style="color: #ff0000;">&quot;500&quot;</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:motionPaths</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:SimpleMotionPath</span> id=<span style="color: #ff0000;">&quot;pth&quot;</span> property=<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:motionPaths</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:Animate</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/fx:Declarations</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Scroller</span> id=<span style="color: #ff0000;">&quot;scrllr&quot;</span></span>
<span style="color: #000000;">            focusEnabled=<span style="color: #ff0000;">&quot;false&quot;</span></span>
<span style="color: #000000;">            hasFocusableChildren=<span style="color: #ff0000;">&quot;true&quot;</span></span>
<span style="color: #000000;">            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 style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:VGroup</span> id=<span style="color: #ff0000;">&quot;vg&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> paddingTop=<span style="color: #ff0000;">&quot;10&quot;</span> paddingBottom=<span style="color: #ff0000;">&quot;10&quot;</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:TextInput</span> text=<span style="color: #ff0000;">&quot;One&quot;</span> focusIn=<span style="color: #ff0000;">&quot;textinput_focusInHandler(event);&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:TextInput</span> text=<span style="color: #ff0000;">&quot;Two&quot;</span> focusIn=<span style="color: #ff0000;">&quot;textinput_focusInHandler(event);&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:TextInput</span> text=<span style="color: #ff0000;">&quot;Three&quot;</span> focusIn=<span style="color: #ff0000;">&quot;textinput_focusInHandler(event);&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:TextInput</span> text=<span style="color: #ff0000;">&quot;Four&quot;</span> focusIn=<span style="color: #ff0000;">&quot;textinput_focusInHandler(event);&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:TextInput</span> text=<span style="color: #ff0000;">&quot;Five&quot;</span> focusIn=<span style="color: #ff0000;">&quot;textinput_focusInHandler(event);&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:TextInput</span> text=<span style="color: #ff0000;">&quot;Six&quot;</span> focusIn=<span style="color: #ff0000;">&quot;textinput_focusInHandler(event);&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:TextInput</span> text=<span style="color: #ff0000;">&quot;Seven&quot;</span> focusIn=<span style="color: #ff0000;">&quot;textinput_focusInHandler(event);&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:TextInput</span> text=<span style="color: #ff0000;">&quot;Eight&quot;</span> focusIn=<span style="color: #ff0000;">&quot;textinput_focusInHandler(event);&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:TextInput</span> text=<span style="color: #ff0000;">&quot;Nine&quot;</span> focusIn=<span style="color: #ff0000;">&quot;textinput_focusInHandler(event);&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:VGroup</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:Scroller</span><span style="color: #7400FF;">&gt;</span></span>
&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: 'Auto scrolling the contents of a VGroup container in Flex 4 on FlexExamples.com',url: 'http://blog.flexexamples.com/2009/11/02/auto-scrolling-the-contents-of-a-vgroup-container-in-flex-4/',contentID: 'post-2136',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'fractionOfElementInView(),getElementIndex(),getScrollPositionDeltaToElement(),Gumbo,layout,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/11/02/auto-scrolling-the-contents-of-a-vgroup-container-in-flex-4/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Determining how much of an item is visible in a scrolling VGroup container in Flex 4</title>
		<link>http://blog.flexexamples.com/2009/10/31/determining-how-much-of-an-item-is-visible-in-a-scrolling-vgroup-container-in-flex-4/</link>
		<comments>http://blog.flexexamples.com/2009/10/31/determining-how-much-of-an-item-is-visible-in-a-scrolling-vgroup-container-in-flex-4/#comments</comments>
		<pubDate>Sat, 31 Oct 2009 14:45:06 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[beta2]]></category>
		<category><![CDATA[Scroller (Spark)]]></category>
		<category><![CDATA[VerticalLayout (Spark)]]></category>
		<category><![CDATA[VGroup (Spark)]]></category>
		<category><![CDATA[firstIndexInView]]></category>
		<category><![CDATA[fractionOfElementInView()]]></category>
		<category><![CDATA[Gumbo]]></category>
		<category><![CDATA[lastIndexInView]]></category>
		<category><![CDATA[layout]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/?p=2122</guid>
		<description><![CDATA[<p>In a previous example, <a href="http://blog.flexexamples.com/2009/10/30/determining-the-first-and-last-visible-item-in-a-scrolling-vgroup-container-in-flex-4/">&#8220;Determining the first and last visible item in a scrolling VGroup container in Flex 4&#8243;</a>, we saw how you could determine the first and last item in a Spark VGroup container&#8217;s view by using the firstIndexInView and lastIndexInView properties on the VGroup container&#8217;s layout property.</p> <p>The following example shows how [...]]]></description>
			<content:encoded><![CDATA[<p>In a previous example, <a href="http://blog.flexexamples.com/2009/10/30/determining-the-first-and-last-visible-item-in-a-scrolling-vgroup-container-in-flex-4/">&#8220;Determining the first and last visible item in a scrolling VGroup container in Flex 4&#8243;</a>, we saw how you could determine the first and last item in a Spark VGroup container&#8217;s view by using the <code>firstIndexInView</code> and <code>lastIndexInView</code> properties on the VGroup container&#8217;s <code>layout</code> property.</p>
<p>The following example shows how you can determine how much of an item is visible in a scrolling VGroup container in Flex 4 by using the <code>fractionOfElementInView()</code> method.</p>
<p>Full code after the jump.</p>
<p><span id="more-2122"></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/31/determining-how-much-of-an-item-is-visible-in-a-scrolling-vgroup-container-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_VGroup_layout_fractionOfElementInView_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 spark.layouts.VerticalLayout;</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;">                scrllr.verticalScrollBar.addEventListener<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;valueCommit&quot;</span>, scrllrVSB_change<span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                scrllrVSB_change<span style="color: #66cc66;">&#40;</span>null<span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">            <span style="color: #66cc66;">&#125;</span></span>
&nbsp;
<span style="color: #000000;">            private function scrllrVSB_change<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;">                var vLay:VerticalLayout = vgr.layout as VerticalLayout;</span>
<span style="color: #000000;">                var fIndex:int = vLay.firstIndexInView;</span>
<span style="color: #000000;">                var fObj:Object = vgr.getElementAt<span style="color: #66cc66;">&#40;</span>fIndex<span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                var lIndex:int = vLay.lastIndexInView;</span>
<span style="color: #000000;">                var lObj:Object = vgr.getElementAt<span style="color: #66cc66;">&#40;</span>lIndex<span style="color: #66cc66;">&#41;</span>;</span>
&nbsp;
<span style="color: #000000;">                lbl1.text = vLay.fractionOfElementInView<span style="color: #66cc66;">&#40;</span>fIndex<span style="color: #66cc66;">&#41;</span>.toFixed<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">2</span><span style="color: #66cc66;">&#41;</span> + <span style="color: #ff0000;">&quot; (&quot;</span> + fObj.label + <span style="color: #ff0000;">&quot;)&quot;</span>;</span>
<span style="color: #000000;">                lbl2.text = vLay.fractionOfElementInView<span style="color: #66cc66;">&#40;</span>lIndex<span style="color: #66cc66;">&#41;</span>.toFixed<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">2</span><span style="color: #66cc66;">&#41;</span> + <span style="color: #ff0000;">&quot; (&quot;</span> + lObj.label + <span style="color: #ff0000;">&quot;)&quot;</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:Panel</span> title=<span style="color: #ff0000;">&quot;Spark Panel&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:Scroller</span> id=<span style="color: #ff0000;">&quot;scrllr&quot;</span></span>
<span style="color: #000000;">                width=<span style="color: #ff0000;">&quot;300&quot;</span> height=<span style="color: #ff0000;">&quot;100&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:VGroup</span> id=<span style="color: #ff0000;">&quot;vgr&quot;</span></span>
<span style="color: #000000;">                    paddingLeft=<span style="color: #ff0000;">&quot;5&quot;</span> paddingRight=<span style="color: #ff0000;">&quot;5&quot;</span> paddingTop=<span style="color: #ff0000;">&quot;5&quot;</span> paddingBottom=<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:Button</span> id=<span style="color: #ff0000;">&quot;ch1&quot;</span> label=<span style="color: #ff0000;">&quot;One&quot;</span> width=<span style="color: #ff0000;">&quot;100%&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Button</span> id=<span style="color: #ff0000;">&quot;ch2&quot;</span> label=<span style="color: #ff0000;">&quot;Two&quot;</span> width=<span style="color: #ff0000;">&quot;100%&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Button</span> id=<span style="color: #ff0000;">&quot;ch3&quot;</span> label=<span style="color: #ff0000;">&quot;Three&quot;</span> width=<span style="color: #ff0000;">&quot;100%&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Button</span> id=<span style="color: #ff0000;">&quot;ch4&quot;</span> label=<span style="color: #ff0000;">&quot;Four&quot;</span> width=<span style="color: #ff0000;">&quot;100%&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Button</span> id=<span style="color: #ff0000;">&quot;ch5&quot;</span> label=<span style="color: #ff0000;">&quot;Five&quot;</span> width=<span style="color: #ff0000;">&quot;100%&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Button</span> id=<span style="color: #ff0000;">&quot;ch6&quot;</span> label=<span style="color: #ff0000;">&quot;Six&quot;</span> width=<span style="color: #ff0000;">&quot;100%&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Button</span> id=<span style="color: #ff0000;">&quot;ch7&quot;</span> label=<span style="color: #ff0000;">&quot;Seven&quot;</span> width=<span style="color: #ff0000;">&quot;100%&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Button</span> id=<span style="color: #ff0000;">&quot;ch8&quot;</span> label=<span style="color: #ff0000;">&quot;Eight&quot;</span> width=<span style="color: #ff0000;">&quot;100%&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Button</span> id=<span style="color: #ff0000;">&quot;ch9&quot;</span> label=<span style="color: #ff0000;">&quot;Nine&quot;</span> width=<span style="color: #ff0000;">&quot;100%&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:VGroup</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:Scroller</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s: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;firstIndexInView:&quot;</span><span style="color: #7400FF;">&gt;</span></span>
                    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Label</span> id=<span style="color: #ff0000;">&quot;lbl1&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;lastIndexInView:&quot;</span><span style="color: #7400FF;">&gt;</span></span>
                    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Label</span> id=<span style="color: #ff0000;">&quot;lbl2&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>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:Panel</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
<span style="color: #000000;"><span style="color: #7400FF;">&lt;/s: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: 'Determining how much of an item is visible in a scrolling VGroup container in Flex 4 on FlexExamples.com',url: 'http://blog.flexexamples.com/2009/10/31/determining-how-much-of-an-item-is-visible-in-a-scrolling-vgroup-container-in-flex-4/',contentID: 'post-2122',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'firstIndexInView,fractionOfElementInView(),Gumbo,lastIndexInView,layout',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/31/determining-how-much-of-an-item-is-visible-in-a-scrolling-vgroup-container-in-flex-4/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Determining the first and last visible item in a scrolling VGroup container in Flex 4</title>
		<link>http://blog.flexexamples.com/2009/10/30/determining-the-first-and-last-visible-item-in-a-scrolling-vgroup-container-in-flex-4/</link>
		<comments>http://blog.flexexamples.com/2009/10/30/determining-the-first-and-last-visible-item-in-a-scrolling-vgroup-container-in-flex-4/#comments</comments>
		<pubDate>Fri, 30 Oct 2009 14:29:57 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[beta2]]></category>
		<category><![CDATA[Scroller (Spark)]]></category>
		<category><![CDATA[VerticalLayout (Spark)]]></category>
		<category><![CDATA[VGroup (Spark)]]></category>
		<category><![CDATA[firstIndexInView]]></category>
		<category><![CDATA[getElementAt()]]></category>
		<category><![CDATA[Gumbo]]></category>
		<category><![CDATA[lastIndexInView]]></category>
		<category><![CDATA[layout]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/?p=2119</guid>
		<description><![CDATA[<p>The following example shows how you can determine the first and last item in a Spark VGroup container&#8217;s view by using the firstIndexInView and lastIndexInView properties on the VGroup container&#8217;s layout 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/10/30/determining-the-first-and-last-visible-item-in-a-scrolling-vgroup-container-in-flex-4/ --&#62; &#60;s:Application name=&#34;Spark_VGroup_firstIndexInView_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:Script&#62; &#60;!&#91;CDATA&#91; import spark.layouts.VerticalLayout; &#160; [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can determine the first and last item in a Spark VGroup container&#8217;s view by using the <code>firstIndexInView</code> and <code>lastIndexInView</code> properties on the VGroup container&#8217;s <code>layout</code> property.</p>
<p>Full code after the jump.</p>
<p><span id="more-2119"></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/30/determining-the-first-and-last-visible-item-in-a-scrolling-vgroup-container-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_VGroup_firstIndexInView_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 spark.layouts.VerticalLayout;</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;">                scrllr.verticalScrollBar.addEventListener<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;valueCommit&quot;</span>, scrllrVSB_change<span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                scrllrVSB_change<span style="color: #66cc66;">&#40;</span>null<span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">            <span style="color: #66cc66;">&#125;</span></span>
&nbsp;
<span style="color: #000000;">            private function scrllrVSB_change<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;">                var fIndex:int = VerticalLayout<span style="color: #66cc66;">&#40;</span>vgr.layout<span style="color: #66cc66;">&#41;</span>.firstIndexInView;</span>
<span style="color: #000000;">                var fObj:Object = vgr.getElementAt<span style="color: #66cc66;">&#40;</span>fIndex<span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                var lIndex:int = VerticalLayout<span style="color: #66cc66;">&#40;</span>vgr.layout<span style="color: #66cc66;">&#41;</span>.lastIndexInView;</span>
<span style="color: #000000;">                var lObj:Object = vgr.getElementAt<span style="color: #66cc66;">&#40;</span>lIndex<span style="color: #66cc66;">&#41;</span>;</span>
&nbsp;
<span style="color: #000000;">                lbl1.text = fIndex.toString<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> + <span style="color: #ff0000;">&quot; (&quot;</span> + fObj.label + <span style="color: #ff0000;">&quot;)&quot;</span>;</span>
<span style="color: #000000;">                lbl2.text = lIndex.toString<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> + <span style="color: #ff0000;">&quot; (&quot;</span> + lObj.label + <span style="color: #ff0000;">&quot;)&quot;</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:Panel</span> title=<span style="color: #ff0000;">&quot;Spark Panel&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:Scroller</span> id=<span style="color: #ff0000;">&quot;scrllr&quot;</span></span>
<span style="color: #000000;">                width=<span style="color: #ff0000;">&quot;300&quot;</span> height=<span style="color: #ff0000;">&quot;100&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:VGroup</span> id=<span style="color: #ff0000;">&quot;vgr&quot;</span></span>
<span style="color: #000000;">                    paddingLeft=<span style="color: #ff0000;">&quot;5&quot;</span> paddingRight=<span style="color: #ff0000;">&quot;5&quot;</span> paddingTop=<span style="color: #ff0000;">&quot;5&quot;</span> paddingBottom=<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:Button</span> id=<span style="color: #ff0000;">&quot;ch1&quot;</span> label=<span style="color: #ff0000;">&quot;One&quot;</span> width=<span style="color: #ff0000;">&quot;100%&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Button</span> id=<span style="color: #ff0000;">&quot;ch2&quot;</span> label=<span style="color: #ff0000;">&quot;Two&quot;</span> width=<span style="color: #ff0000;">&quot;100%&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Button</span> id=<span style="color: #ff0000;">&quot;ch3&quot;</span> label=<span style="color: #ff0000;">&quot;Three&quot;</span> width=<span style="color: #ff0000;">&quot;100%&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Button</span> id=<span style="color: #ff0000;">&quot;ch4&quot;</span> label=<span style="color: #ff0000;">&quot;Four&quot;</span> width=<span style="color: #ff0000;">&quot;100%&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Button</span> id=<span style="color: #ff0000;">&quot;ch5&quot;</span> label=<span style="color: #ff0000;">&quot;Five&quot;</span> width=<span style="color: #ff0000;">&quot;100%&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Button</span> id=<span style="color: #ff0000;">&quot;ch6&quot;</span> label=<span style="color: #ff0000;">&quot;Six&quot;</span> width=<span style="color: #ff0000;">&quot;100%&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Button</span> id=<span style="color: #ff0000;">&quot;ch7&quot;</span> label=<span style="color: #ff0000;">&quot;Seven&quot;</span> width=<span style="color: #ff0000;">&quot;100%&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Button</span> id=<span style="color: #ff0000;">&quot;ch8&quot;</span> label=<span style="color: #ff0000;">&quot;Eight&quot;</span> width=<span style="color: #ff0000;">&quot;100%&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Button</span> id=<span style="color: #ff0000;">&quot;ch9&quot;</span> label=<span style="color: #ff0000;">&quot;Nine&quot;</span> width=<span style="color: #ff0000;">&quot;100%&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:VGroup</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:Scroller</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s: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;firstIndexInView:&quot;</span><span style="color: #7400FF;">&gt;</span></span>
                    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Label</span> id=<span style="color: #ff0000;">&quot;lbl1&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;lastIndexInView:&quot;</span><span style="color: #7400FF;">&gt;</span></span>
                    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Label</span> id=<span style="color: #ff0000;">&quot;lbl2&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>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:Panel</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
<span style="color: #000000;"><span style="color: #7400FF;">&lt;/s: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: 'Determining the first and last visible item in a scrolling VGroup container in Flex 4 on FlexExamples.com',url: 'http://blog.flexexamples.com/2009/10/30/determining-the-first-and-last-visible-item-in-a-scrolling-vgroup-container-in-flex-4/',contentID: 'post-2119',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'firstIndexInView,getElementAt(),Gumbo,lastIndexInView,layout',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/30/determining-the-first-and-last-visible-item-in-a-scrolling-vgroup-container-in-flex-4/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Toggling variable row heights on a Spark VGroup container in Flex 4</title>
		<link>http://blog.flexexamples.com/2009/10/02/toggling-variable-row-heights-on-a-spark-vgroup-container-in-flex-4/</link>
		<comments>http://blog.flexexamples.com/2009/10/02/toggling-variable-row-heights-on-a-spark-vgroup-container-in-flex-4/#comments</comments>
		<pubDate>Fri, 02 Oct 2009 15:26:00 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[beta1]]></category>
		<category><![CDATA[VGroup (Spark)]]></category>
		<category><![CDATA[Gumbo]]></category>
		<category><![CDATA[variableRowHeight]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/?p=1961</guid>
		<description><![CDATA[<p>The following example shows how you can toggle variable item/row heights on a Spark VGroup container in Flex 4 by setting the Boolean variableRowHeight 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/10/02/toggling-variable-row-heights-on-a-spark-vgroup-container-in-flex-4/ --&#62; &#60;s:Application name=&#34;Spark_VGroup_variableRowHeight_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;s:CheckBox id=&#34;chckBx&#34; label=&#34;variableRowHeight&#34; selected=&#34;true&#34; /&#62; &#60;/s:controlBarContent&#62; &#160; &#60;s:VGroup id=&#34;vGr&#34; variableRowHeight=&#34;{chckBx.selected}&#34; width=&#34;200&#34; horizontalCenter=&#34;0&#34; [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can toggle variable item/row heights on a Spark VGroup container in Flex 4 by setting the Boolean <code>variableRowHeight</code> property.</p>
<p>Full code after the jump.</p>
<p><span id="more-1961"></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/02/toggling-variable-row-heights-on-a-spark-vgroup-container-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_VGroup_variableRowHeight_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;s:CheckBox</span> id=<span style="color: #ff0000;">&quot;chckBx&quot;</span> label=<span style="color: #ff0000;">&quot;variableRowHeight&quot;</span> selected=<span style="color: #ff0000;">&quot;true&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:controlBarContent</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:VGroup</span> id=<span style="color: #ff0000;">&quot;vGr&quot;</span></span>
<span style="color: #000000;">            variableRowHeight=<span style="color: #ff0000;">&quot;{chckBx.selected}&quot;</span></span>
<span style="color: #000000;">            width=<span style="color: #ff0000;">&quot;200&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:Border</span> id=<span style="color: #ff0000;">&quot;brdr1&quot;</span></span>
<span style="color: #000000;">                backgroundColor=<span style="color: #ff0000;">&quot;red&quot;</span></span>
<span style="color: #000000;">                width=<span style="color: #ff0000;">&quot;100%&quot;</span> height=<span style="color: #ff0000;">&quot;30&quot;</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Label</span> text=<span style="color: #ff0000;">&quot;{brdr1.width}x{brdr1.height}&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:Border</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Border</span> id=<span style="color: #ff0000;">&quot;brdr2&quot;</span></span>
<span style="color: #000000;">                backgroundColor=<span style="color: #ff0000;">&quot;haloOrange&quot;</span></span>
<span style="color: #000000;">                width=<span style="color: #ff0000;">&quot;100%&quot;</span> height=<span style="color: #ff0000;">&quot;60&quot;</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Label</span> text=<span style="color: #ff0000;">&quot;{brdr2.width}x{brdr2.height}&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:Border</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Border</span> id=<span style="color: #ff0000;">&quot;brdr3&quot;</span></span>
<span style="color: #000000;">                backgroundColor=<span style="color: #ff0000;">&quot;yellow&quot;</span></span>
<span style="color: #000000;">                width=<span style="color: #ff0000;">&quot;100%&quot;</span> height=<span style="color: #ff0000;">&quot;20&quot;</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Label</span> text=<span style="color: #ff0000;">&quot;{brdr3.width}x{brdr3.height}&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:Border</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Border</span> id=<span style="color: #ff0000;">&quot;brdr4&quot;</span></span>
<span style="color: #000000;">                backgroundColor=<span style="color: #ff0000;">&quot;haloGreen&quot;</span></span>
<span style="color: #000000;">                width=<span style="color: #ff0000;">&quot;100%&quot;</span> height=<span style="color: #ff0000;">&quot;90&quot;</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Label</span> text=<span style="color: #ff0000;">&quot;{brdr4.width}x{brdr4.height}&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:Border</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Border</span> id=<span style="color: #ff0000;">&quot;brdr5&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> height=<span style="color: #ff0000;">&quot;40&quot;</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Label</span> text=<span style="color: #ff0000;">&quot;{brdr5.width}x{brdr5.height}&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:Border</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:VGroup</span><span style="color: #7400FF;">&gt;</span></span>
&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 variable row heights on a Spark VGroup container in Flex 4 on FlexExamples.com',url: 'http://blog.flexexamples.com/2009/10/02/toggling-variable-row-heights-on-a-spark-vgroup-container-in-flex-4/',contentID: 'post-1961',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'Gumbo,variableRowHeight',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/02/toggling-variable-row-heights-on-a-spark-vgroup-container-in-flex-4/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Setting the requested row count on a Spark VGroup container in Flex 4</title>
		<link>http://blog.flexexamples.com/2009/09/10/setting-the-requested-row-count-on-a-spark-vgroup-container-in-flex-4/</link>
		<comments>http://blog.flexexamples.com/2009/09/10/setting-the-requested-row-count-on-a-spark-vgroup-container-in-flex-4/#comments</comments>
		<pubDate>Fri, 11 Sep 2009 06:59:56 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[beta1]]></category>
		<category><![CDATA[VGroup (Spark)]]></category>
		<category><![CDATA[clipAndEnableScrolling]]></category>
		<category><![CDATA[firstIndexInView]]></category>
		<category><![CDATA[Gumbo]]></category>
		<category><![CDATA[lastIndexInView]]></category>
		<category><![CDATA[requestedRowCount]]></category>
		<category><![CDATA[rowCount]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/?p=1955</guid>
		<description><![CDATA[<p>The following example shows how you can set the requested row count on a Spark VGroup container in Flex 4 by setting the requestedRowCount 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/09/10/setting-the-requested-row-count-on-a-spark-vgroup-container-in-flex-4/ --&#62; &#60;s:Application name=&#34;Spark_VGroup_requestedRowCount_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&#62; &#60;mx:FormItem label=&#34;requestedRowCount:&#34;&#62; &#60;s:HSlider id=&#34;sldr&#34; minimum=&#34;0&#34; maximum=&#34;7&#34; value=&#34;{vGr.numElements}&#34; /&#62; &#60;/mx:FormItem&#62; &#60;/mx:Form&#62; &#60;/s:controlBarContent&#62; [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can set the requested row count on a Spark VGroup container in Flex 4 by setting the <code>requestedRowCount</code> property.</p>
<p>Full code after the jump.</p>
<p><span id="more-1955"></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/09/10/setting-the-requested-row-count-on-a-spark-vgroup-container-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_VGroup_requestedRowCount_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><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;requestedRowCount:&quot;</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:HSlider</span> id=<span style="color: #ff0000;">&quot;sldr&quot;</span></span>
<span style="color: #000000;">                        minimum=<span style="color: #ff0000;">&quot;0&quot;</span></span>
<span style="color: #000000;">                        maximum=<span style="color: #ff0000;">&quot;7&quot;</span></span>
<span style="color: #000000;">                        value=<span style="color: #ff0000;">&quot;{vGr.numElements}&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:FormItem</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:Form</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:controlBarContent</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Panel</span> id=<span style="color: #ff0000;">&quot;pnl&quot;</span></span>
<span style="color: #000000;">            title=<span style="color: #ff0000;">&quot;rowCount={vGr.rowCount}&quot;</span></span>
<span style="color: #000000;">            width=<span style="color: #ff0000;">&quot;250&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:VGroup</span> id=<span style="color: #ff0000;">&quot;vGr&quot;</span></span>
<span style="color: #000000;">                requestedRowCount=<span style="color: #ff0000;">&quot;{sldr.value}&quot;</span></span>
<span style="color: #000000;">                clipAndEnableScrolling=<span style="color: #ff0000;">&quot;true&quot;</span></span>
<span style="color: #000000;">                width=<span style="color: #ff0000;">&quot;100%&quot;</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Border</span> backgroundColor=<span style="color: #ff0000;">&quot;red&quot;</span> width=<span style="color: #ff0000;">&quot;100%&quot;</span> height=<span style="color: #ff0000;">&quot;30&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Border</span> backgroundColor=<span style="color: #ff0000;">&quot;haloOrange&quot;</span> width=<span style="color: #ff0000;">&quot;100%&quot;</span> height=<span style="color: #ff0000;">&quot;30&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Border</span> backgroundColor=<span style="color: #ff0000;">&quot;yellow&quot;</span> width=<span style="color: #ff0000;">&quot;100%&quot;</span> height=<span style="color: #ff0000;">&quot;30&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Border</span> backgroundColor=<span style="color: #ff0000;">&quot;haloGreen&quot;</span> width=<span style="color: #ff0000;">&quot;100%&quot;</span> height=<span style="color: #ff0000;">&quot;30&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Border</span> backgroundColor=<span style="color: #ff0000;">&quot;haloBlue&quot;</span> width=<span style="color: #ff0000;">&quot;100%&quot;</span> height=<span style="color: #ff0000;">&quot;30&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:VGroup</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s: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;firstIndexInView:&quot;</span><span style="color: #7400FF;">&gt;</span></span>
                    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Label</span> text=<span style="color: #ff0000;">&quot;{vGr.firstIndexInView}&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;lastIndexInView:&quot;</span><span style="color: #7400FF;">&gt;</span></span>
                    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Label</span> text=<span style="color: #ff0000;">&quot;{vGr.lastIndexInView}&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>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:Panel</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
<span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:Application</span><span style="color: #7400FF;">&gt;</span></span></pre></div></div>

<p>You can also set the <code>requestedRowCount</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/09/10/setting-the-requested-row-count-on-a-spark-vgroup-container-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_VGroup_requestedRowCount_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><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;requestedRowCount:&quot;</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:HSlider</span> id=<span style="color: #ff0000;">&quot;sldr&quot;</span></span>
<span style="color: #000000;">                        minimum=<span style="color: #ff0000;">&quot;0&quot;</span></span>
<span style="color: #000000;">                        maximum=<span style="color: #ff0000;">&quot;7&quot;</span></span>
<span style="color: #000000;">                        value=<span style="color: #ff0000;">&quot;{vGr.numElements}&quot;</span></span>
<span style="color: #000000;">                        change=<span style="color: #ff0000;">&quot;sldr_change(event);&quot;</span><span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:FormItem</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:Form</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:controlBarContent</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Script</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;">&lt;!<span style="color: #66cc66;">&#91;</span>CDATA<span style="color: #66cc66;">&#91;</span></span>
<span style="color: #000000;">            protected function sldr_change<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;">                vGr.requestedRowCount = sldr.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:Panel</span> id=<span style="color: #ff0000;">&quot;pnl&quot;</span></span>
<span style="color: #000000;">            title=<span style="color: #ff0000;">&quot;rowCount={vGr.rowCount}&quot;</span></span>
<span style="color: #000000;">            width=<span style="color: #ff0000;">&quot;250&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:VGroup</span> id=<span style="color: #ff0000;">&quot;vGr&quot;</span></span>
<span style="color: #000000;">                clipAndEnableScrolling=<span style="color: #ff0000;">&quot;true&quot;</span></span>
<span style="color: #000000;">                width=<span style="color: #ff0000;">&quot;100%&quot;</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Border</span> backgroundColor=<span style="color: #ff0000;">&quot;red&quot;</span> width=<span style="color: #ff0000;">&quot;100%&quot;</span> height=<span style="color: #ff0000;">&quot;30&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Border</span> backgroundColor=<span style="color: #ff0000;">&quot;haloOrange&quot;</span> width=<span style="color: #ff0000;">&quot;100%&quot;</span> height=<span style="color: #ff0000;">&quot;30&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Border</span> backgroundColor=<span style="color: #ff0000;">&quot;yellow&quot;</span> width=<span style="color: #ff0000;">&quot;100%&quot;</span> height=<span style="color: #ff0000;">&quot;30&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Border</span> backgroundColor=<span style="color: #ff0000;">&quot;haloGreen&quot;</span> width=<span style="color: #ff0000;">&quot;100%&quot;</span> height=<span style="color: #ff0000;">&quot;30&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Border</span> backgroundColor=<span style="color: #ff0000;">&quot;haloBlue&quot;</span> width=<span style="color: #ff0000;">&quot;100%&quot;</span> height=<span style="color: #ff0000;">&quot;30&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:VGroup</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s: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;firstIndexInView:&quot;</span><span style="color: #7400FF;">&gt;</span></span>
                    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Label</span> text=<span style="color: #ff0000;">&quot;{vGr.firstIndexInView}&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;lastIndexInView:&quot;</span><span style="color: #7400FF;">&gt;</span></span>
                    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Label</span> text=<span style="color: #ff0000;">&quot;{vGr.lastIndexInView}&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>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:Panel</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
<span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:Application</span><span style="color: #7400FF;">&gt;</span></span></pre></div></div>

<p>Due to popular demand, here is the “same” example in a more ActionScript friendly format:</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/09/10/setting-the-requested-row-count-on-a-spark-vgroup-container-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_VGroup_requestedRowCount_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>
<span style="color: #000000;">        initialize=<span style="color: #ff0000;">&quot;init();&quot;</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Script</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;">&lt;!<span style="color: #66cc66;">&#91;</span>CDATA<span style="color: #66cc66;">&#91;</span></span>
<span style="color: #000000;">            import mx.containers.Form;</span>
<span style="color: #000000;">            import mx.containers.FormItem;</span>
<span style="color: #000000;">            import mx.core.FlexGlobals;</span>
&nbsp;
<span style="color: #000000;">            import spark.components.Border;</span>
<span style="color: #000000;">            import spark.components.HSlider;</span>
<span style="color: #000000;">            import spark.components.Label;</span>
<span style="color: #000000;">            import spark.components.Panel;</span>
<span style="color: #000000;">            import spark.components.VGroup;</span>
&nbsp;
<span style="color: #000000;">            protected var pnl:Panel;</span>
<span style="color: #000000;">            protected var sldr:HSlider;</span>
<span style="color: #000000;">            protected var vGr:VGroup;</span>
<span style="color: #000000;">            protected var firstIndexLabel:Label;</span>
<span style="color: #000000;">            protected var lastIndexLabel:Label;</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;">                sldr = new HSlider<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                sldr.minimum = <span style="color: #cc66cc;">0</span>;</span>
<span style="color: #000000;">                sldr.maximum = <span style="color: #cc66cc;">7</span>;</span>
<span style="color: #000000;">                sldr.addEventListener<span style="color: #66cc66;">&#40;</span>Event.CHANGE, sldr_change<span style="color: #66cc66;">&#41;</span>;</span>
&nbsp;
<span style="color: #000000;">                var formItem:FormItem = new FormItem<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                formItem.label = <span style="color: #ff0000;">&quot;requestedRowCount:&quot;</span>;</span>
<span style="color: #000000;">                formItem.addElement<span style="color: #66cc66;">&#40;</span>sldr<span style="color: #66cc66;">&#41;</span>;</span>
&nbsp;
<span style="color: #000000;">                var form1:Form = new Form<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                form1.addElement<span style="color: #66cc66;">&#40;</span>formItem<span style="color: #66cc66;">&#41;</span>;</span>
&nbsp;
<span style="color: #000000;">                Application<span style="color: #66cc66;">&#40;</span>FlexGlobals.topLevelApplication<span style="color: #66cc66;">&#41;</span>.controlBarContent = <span style="color: #66cc66;">&#91;</span>form1<span style="color: #66cc66;">&#93;</span>;</span>
&nbsp;
<span style="color: #000000;">                var brdr1:Border = new Border<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                brdr1.setStyle<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;backgroundColor&quot;</span>, <span style="color: #ff0000;">&quot;red&quot;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                brdr1.percentWidth = <span style="color: #cc66cc;">100</span>;</span>
<span style="color: #000000;">                brdr1.height = <span style="color: #cc66cc;">30</span>;</span>
&nbsp;
<span style="color: #000000;">                var brdr2:Border = new Border<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                brdr2.setStyle<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;backgroundColor&quot;</span>, <span style="color: #ff0000;">&quot;haloOrange&quot;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                brdr2.percentWidth = <span style="color: #cc66cc;">100</span>;</span>
<span style="color: #000000;">                brdr2.height = <span style="color: #cc66cc;">30</span>;</span>
&nbsp;
<span style="color: #000000;">                var brdr3:Border = new Border<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                brdr3.setStyle<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;backgroundColor&quot;</span>, <span style="color: #ff0000;">&quot;yellow&quot;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                brdr3.percentWidth = <span style="color: #cc66cc;">100</span>;</span>
<span style="color: #000000;">                brdr3.height = <span style="color: #cc66cc;">30</span>;</span>
&nbsp;
<span style="color: #000000;">                var brdr4:Border = new Border<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                brdr4.setStyle<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;backgroundColor&quot;</span>, <span style="color: #ff0000;">&quot;haloGreen&quot;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                brdr4.percentWidth = <span style="color: #cc66cc;">100</span>;</span>
<span style="color: #000000;">                brdr4.height = <span style="color: #cc66cc;">30</span>;</span>
&nbsp;
<span style="color: #000000;">                var brdr5:Border = new Border<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                brdr5.setStyle<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;backgroundColor&quot;</span>, <span style="color: #ff0000;">&quot;haloBlue&quot;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                brdr5.percentWidth = <span style="color: #cc66cc;">100</span>;</span>
<span style="color: #000000;">                brdr5.height = <span style="color: #cc66cc;">30</span>;</span>
&nbsp;
<span style="color: #000000;">                vGr = new VGroup<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                vGr.clipAndEnableScrolling = true;</span>
<span style="color: #000000;">                vGr.percentWidth = <span style="color: #cc66cc;">100</span>;</span>
<span style="color: #000000;">                vGr.addElement<span style="color: #66cc66;">&#40;</span>brdr1<span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                vGr.addElement<span style="color: #66cc66;">&#40;</span>brdr2<span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                vGr.addElement<span style="color: #66cc66;">&#40;</span>brdr3<span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                vGr.addElement<span style="color: #66cc66;">&#40;</span>brdr4<span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                vGr.addElement<span style="color: #66cc66;">&#40;</span>brdr5<span style="color: #66cc66;">&#41;</span>;</span>
&nbsp;
<span style="color: #000000;">                firstIndexLabel = new Label<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</span>
&nbsp;
<span style="color: #000000;">                lastIndexLabel = new Label<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</span>
&nbsp;
<span style="color: #000000;">                var formItem1:FormItem = new FormItem<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                formItem1.label = <span style="color: #ff0000;">&quot;firstIndexInView:&quot;</span>;</span>
<span style="color: #000000;">                formItem1.addElement<span style="color: #66cc66;">&#40;</span>firstIndexLabel<span style="color: #66cc66;">&#41;</span>;</span>
&nbsp;
<span style="color: #000000;">                var formItem2:FormItem = new FormItem<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                formItem2.label = <span style="color: #ff0000;">&quot;lastIndexInView:&quot;</span>;</span>
<span style="color: #000000;">                formItem2.addElement<span style="color: #66cc66;">&#40;</span>lastIndexLabel<span style="color: #66cc66;">&#41;</span>;</span>
&nbsp;
<span style="color: #000000;">                var form2:Form = new Form<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                form2.styleName = <span style="color: #ff0000;">&quot;plain&quot;</span>;</span>
<span style="color: #000000;">                form2.setStyle<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;backgroundAlpha&quot;</span>, <span style="color: #cc66cc;">0.0</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                form2.addElement<span style="color: #66cc66;">&#40;</span>formItem1<span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                form2.addElement<span style="color: #66cc66;">&#40;</span>formItem2<span style="color: #66cc66;">&#41;</span>;</span>
&nbsp;
<span style="color: #000000;">                pnl = new Panel<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                pnl.width = <span style="color: #cc66cc;">250</span>;</span>
<span style="color: #000000;">                pnl.horizontalCenter = <span style="color: #cc66cc;">0</span>;</span>
<span style="color: #000000;">                pnl.verticalCenter = <span style="color: #cc66cc;">0</span>;</span>
<span style="color: #000000;">                pnl.controlBarContent = <span style="color: #66cc66;">&#91;</span>form2<span style="color: #66cc66;">&#93;</span>;</span>
<span style="color: #000000;">                pnl.addElement<span style="color: #66cc66;">&#40;</span>vGr<span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                addElement<span style="color: #66cc66;">&#40;</span>pnl<span style="color: #66cc66;">&#41;</span>;</span>
&nbsp;
<span style="color: #000000;">                callLater<span style="color: #66cc66;">&#40;</span>updateLabels<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 sldr_change<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;">                vGr.requestedRowCount = sldr.value;</span>
<span style="color: #000000;">                callLater<span style="color: #66cc66;">&#40;</span>updateLabels<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 updateLabels<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:void <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">                pnl.title = <span style="color: #ff0000;">&quot;rowCount=&quot;</span> + vGr.rowCount.toString<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                firstIndexLabel.text = vGr.firstIndexInView.toString<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">                lastIndexLabel.text = vGr.lastIndexInView.toString<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">            <span style="color: #66cc66;">&#125;</span></span>
<span style="color: #000000;">        <span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#93;</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/fx:Script</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
<span style="color: #000000;"><span style="color: #7400FF;">&lt;/s: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 requested row count on a Spark VGroup container in Flex 4 on FlexExamples.com',url: 'http://blog.flexexamples.com/2009/09/10/setting-the-requested-row-count-on-a-spark-vgroup-container-in-flex-4/',contentID: 'post-1955',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'clipAndEnableScrolling,firstIndexInView,Gumbo,lastIndexInView,requestedRowCount,rowCount',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/09/10/setting-the-requested-row-count-on-a-spark-vgroup-container-in-flex-4/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

