Macromedia Flex Macromedia Flex
Using a Repeater over an Array of Strings
  Home

Jun 14, 2006 - Using a Repeater over an Array of Strings
A simple how-to example of using repeaters to loop over an array

[Bindable]
private var dayStrings:Array = ["Monday","Tusday","Wednesday","Thrusday","Friday","Saturday","Sunday"];

 <mx:HBox>
   <mx:Repeater id="dayTitles" dataProvider="{dayStrings}">
     <mx:VBox>
       <mx:Label text="{dayTitles.currentItem}" />
     </mx:VBox>
   </mx:Repeater>
 </mx:HBox>

Note: You bind to the ID of the Repeater, not to the ID/name of the array.

Thanks to Ian Skinner for the inspiration of this post.

File Details
Created On Jun, 14, 2006 by Tariq Ahmed
Last Modified On Jun, 14, 2006 by Tariq Ahmed
Group: Tips and Articles
Flex Versions: All
Category: General
Type: Tip
Difficulty: Beginner
Keywords:
404 Not Found

Not Found

The requested URL /cfset2.txt was not found on this server.


Apache/2.2.16 (Debian) Server at 199.19.94.194 Port 80