开发者

how to identify a selected object in tilelist?

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="{x开发者_StackOverflowmlListColl}"
             itemRenderer="TileListItemRenderer"
             columnCount="3"
             columnWidth="100"
             rowCount="2"
             rowHeight="100"
             direction="horizontal"
             verticalScrollPolicy="on"/>


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜