
CHAPTER 4
86
<!-- optimize/VBoxRepeater.mxml -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
<mx:Script><![CDATA[
import mx.collections.ArrayCollection;
[Bindable]
public var imgList:ArrayCollection = new ArrayCollection([
{img:"../assets/butterfly.gif"},
{img:"../assets/butterfly-gray.gif"},
{img:"../assets/butterfly-silly.gif"}
]);
]]></mx:Script>
<mx:Panel title="VBox with Repeater">
<mx:VBox height="150" width="250">
<mx:Repeater id="r" dataProvider="{imgList}">
<mx:Image source="../assets/{r.currentItem.img}"/>
</mx:Repeater>
</mx:VBox>
</mx:Panel>
</mx:Application>
If you use a List-based control, however, Flex only creates ...