Reputation: 41
I am navigating the items of tile list using next and previous button. I need to highlight the first item in the tilelist by default ( like the first item is being selected by default)
Upvotes: 0
Views: 225
Reputation: 15955
Just require selection, which will default select the first item:
<s:List requireSelection="true">
<s:layout>
<s:TileLayout />
</s:layout>
</s:List>
Otherwise, you can set the selected index:
<s:List selectedIndex="0" />
Or...
<fx:Script>
<![CDATA[
public function selectFirstItem():void
{
list.selectedIndex = 0;
}
]]>
</fx:Script>
<s:List id="list" />
Likewise if you're using the deprecated mx:TileList
<mx:TileList selectedIndex="0" />
Upvotes: 1