动态改变 itemRenderer 。
<?xml version="1.0" encoding="utf-8"?><mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"><mx:Script><![CDATA[import mx.core.ClassFactory;//changes the list item renderer at runtimeprivate function changeRenderer(event:Event):void{if(viewType.selectedValue.toString() == "small")list.itemRenderer = new ClassFactory(makeEmSmall);elselist.itemRenderer = new ClassFactory(makeEmBig);}]]></mx:Script><!-- List --><mx:List x="34" y="92" width="300" height="300"variableRowHeight="true"itemRenderer="makeEmSmall" id="list"alternatingItemColors="[#FFFFFF, #EEEEEE]"themeColor="#8C8196"><mx:dataProvider><mx:String>item 1</mx:String><mx:String>item 2</mx:String><mx:String>item 3</mx:String><mx:String>item 4</mx:String><mx:String>item 5</mx:String><mx:String>item 6</mx:String><mx:String>item 7</mx:String><mx:String>item 8</mx:String><mx:String>item 9</mx:String><mx:String>item 10</mx:String></mx:dataProvider></mx:List><!-- Radio Buttons --><mx:RadioButtonGroup id="viewType" labelPlacement="right" change="{changeRenderer(event);}"/><mx:HBox x="40" y="400"><mx:Text text="View: "></mx:Text><mx:RadioButton label="big" value="big" groupName="viewType" toolTip="Make 'em big dude." /><mx:RadioButton label="small" value="small" groupName="viewType" toolTip="Make 'em small dude." selected="true"/></mx:HBox></mx:Application>