Basic Repeater whose data source is ArrayCollection
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
<mx:Script>
import mx.controls.Alert;
private function clickHandler(item:Object):void {
Alert.show(item.data, "ClickHandler");
}
</mx:Script>
<mx:ArrayCollection id="dp">
<mx:Object label="Button 1" data="Data 1" />
<mx:Object label="Button 2" data="Data 2" />
<mx:Object label="Button 3" data="Data 3" />
</mx:ArrayCollection>
<mx:Panel title="Basic Repeater" layout="horizontal">
<mx:Repeater id="myRepeater" dataProvider="{dp}" >
<mx:Button label="{myRepeater.currentItem.label}" click="clickHandler(event.currentTarget.getRepeaterItem());" />
</mx:Repeater>
</mx:Panel>
</mx:Application>
Related examples in the same category