how to identify a selected object in tilelist?

369 Views Asked by At

I have tilelist, which is dynamically loaded XML file with pictures, How do I do that would be when you click on a picture in the Label gave her name?

 <mx:TileList id="tileList"
             alternatingItemColors="[#FFFFFF,#EEEEEE]"
             dataProvider="{xmlListColl}"
             itemRenderer="TileListItemRenderer"
             columnCount="3"
             columnWidth="100"
             rowCount="2"
             rowHeight="100"
             direction="horizontal"
             verticalScrollPolicy="on"/>
1

There are 1 best solutions below

3
On BEST ANSWER

in your TileList call a function with

itemClick="somthingSelected();"

public function somthingSelected():void{
  trace( this.tileList.selectedItem.@id )
}

"id" is the attribute in your xml dataprovider or whatever you want it to be