<?xml version="1.0" encoding="utf-8"?>
<!-- http://blog.flexexamples.com/2007/10/28/resizing-a-flex-list-control-using-the-rowcount-property/ -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white" viewSourceURL="srcview/index.html">

    <mx:XML id="mlbXML" >
        <teams>
            <league id="AL">
                <team label="Baltimore Orioles" />
                <team label="Boston Red Sox" />
                <team label="Chicago White Sox" />
                <team label="Cleveland Indians" />
                <team label="Detroit Tigers" />
                <team label="Kansas City Royals" />
                <team label="Los Angeles Angels of Anaheim" />
                <team label="Minnesota Twins" />
                <team label="New York Yankees" />
                <team label="Oakland Athletics" />
                <team label="Seattle Mariners" />
                <team label="Tampa Bay Devil Rays" />
                <team label="Texas Rangers" />
                <team label="Toronto Blue Jays" />
            </league>
        </teams>
    </mx:XML>

    <mx:XMLListCollection id="alTeams"
            source="{mlbXML.league.(@id == 'AL').team}" />

    <mx:ApplicationControlBar dock="true">
        <mx:Form>
            <mx:FormItem label="rowCount:">
                <mx:HSlider id="slider"
                        minimum="1"
                        maximum="10"
                        value="{list.rowCount}"
                        snapInterval="1"
                        liveDragging="true"
                        dataTipPrecision="0"
                        change="list.rowCount = event.value;" />
            </mx:FormItem>
        </mx:Form>
    </mx:ApplicationControlBar>

    <mx:VBox id="vBox" height="100%">
        <mx:List id="list"
                maxHeight="{vBox.height}"
                dataProvider="{alTeams}"
                labelField="@label" />
    </mx:VBox>

</mx:Application>
