开发者

how do I trigger an Item renderer create children

开发者 https://www.devze.com 2023-03-10 05:42 出处:网络
I have a TileList with a custom item renderer. I need to change the children of the ItemRenderer when the dataprovider changes for the TileList.

I have a TileList with a custom item renderer.
I need to change the children of the ItemRenderer when the dataprovider changes for the TileList.
Currently,

override protected function createChildren():void{

Works fine with the inital data, but when 开发者_如何学Gothe data changes to a different structure I need to recreate the children somehow.
I image there has to be a way to listen to the TileList for a data change from inside the item renderer, but how? Or is that even the best route to go?


maybe this will do the job :

override public function set data( value : Object ) : void 
{
    super.data = value;
   // things to happend when data is changed ...

}

aswell maybe updateDisplayList() shall need to be overrided aswell to match the changes with the visual components ( if there is ).

0

精彩评论

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