Hihi,
I have an inventory window which has several tabs.
When a tab is selected it a repeater populates the window with a list of items:
[SIZE=2][SIZE=2]<mx:Repeater [/SIZE][/SIZE][SIZE=2]id="[/SIZE][SIZE=2][SIZE=2]iconRepeater[/SIZE][/SIZE][SIZE=2]" count="[/SIZE][SIZE=2][SIZE=2]{[/SIZE][/SIZE][SIZE=2]maxIconsPerPage[/SIZE][SIZE=2][SIZE=2]}[/SIZE][/SIZE][SIZE=2]" startingIndex="[/SIZE][SIZE=2][SIZE=2]{[/SIZE][/SIZE][SIZE=2]pageNumber*maxIconsPerPage[/SIZE][SIZE=2][SIZE=2]}[/SIZE][/SIZE][SIZE=2]" recycleChildren="[/SIZE][SIZE=2][SIZE=2]true[/SIZE][/SIZE][SIZE=2]"[/SIZE][SIZE=2][SIZE=2]>[/SIZE][/SIZE]
[SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]<mx:Canvas>[/COLOR][/SIZE][/COLOR][/SIZE]
[LEFT][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]<UIComponents:Icon[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] itemID="[/SIZE][SIZE=2][COLOR=#990000][SIZE=2][COLOR=#990000]{[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]iconRepeater.currentItem.itemID[/SIZE][SIZE=2][COLOR=#990000][SIZE=2][COLOR=#990000]}[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]"/> [/SIZE][/LEFT]
[SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]</mx:Canvas>[/COLOR][/SIZE][/COLOR][/SIZE]
[SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]</mx:Repeater>[/COLOR][/SIZE][/COLOR][/SIZE]
[LEFT]Now some of the tabs use larger icons so I would like the repeater to populate depending on a variable.
Is something like this possible:[/LEFT]
[SIZE=2][SIZE=2]<mx:Repeater [/SIZE][/SIZE][SIZE=2]id="[/SIZE][SIZE=2][SIZE=2]iconRepeater[/SIZE][/SIZE][SIZE=2]" count="[/SIZE][SIZE=2][SIZE=2]{[/SIZE][/SIZE][SIZE=2]maxIconsPerPage[/SIZE][SIZE=2][SIZE=2]}[/SIZE][/SIZE][SIZE=2]" startingIndex="[/SIZE][SIZE=2][SIZE=2]{[/SIZE][/SIZE][SIZE=2]pageNumber*maxIconsPerPage[/SIZE][SIZE=2][SIZE=2]}[/SIZE][/SIZE][SIZE=2]" recycleChildren="[/SIZE][SIZE=2][SIZE=2]true[/SIZE][/SIZE][SIZE=2]"[/SIZE][SIZE=2][SIZE=2]>[/SIZE][/SIZE]
[SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]<mx:Canvas>[/COLOR][/SIZE][/COLOR][/SIZE]
*if large*
[SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff] <UIComponents:IconLarge[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] itemID="[/SIZE][SIZE=2][COLOR=#990000][SIZE=2][COLOR=#990000]{[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]iconRepeater.currentItem.itemID[/SIZE][SIZE=2][COLOR=#990000][SIZE=2][COLOR=#990000]}[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]"/> [/SIZE]
[LEFT] *else*
[COLOR=#0000ff]<UIComponents:IconSmall[/COLOR][SIZE=2] itemID="[/SIZE][SIZE=2][COLOR=#990000][SIZE=2][COLOR=#990000]{[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]iconRepeater.currentItem.itemID[/SIZE][SIZE=2][COLOR=#990000][SIZE=2][COLOR=#990000]}[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]"/> [/SIZE]
[SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]</mx:Canvas>[/COLOR][/SIZE][/COLOR][/SIZE] [/LEFT]
[SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]</mx:Repeater>[/COLOR][/SIZE][/COLOR][/SIZE]
If this isn’t possible what do you think is the best way to achieve what I am trying to do.
I tried using states but it would add extra children to the start of the list.
I’ve also tried doing this:
At the moment we have
Window -> tab -> icon
Add a largetab class that extends tab but while I was able have different layout variables for the tab class I wasnt able to override the iconRepeater.
Thanks for any suggestions that may come!