开发者

how to identify a selected object in tilelist?

开发者 https://www.devze.com 2023-02-24 11:22 出处:网络
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?

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

精彩评论

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