Jesse
09-04-2006, 12:53 PM
Yup, I'm learning Flex. Started last weekend and have done a few hours so far, in dribs and drabs. And yup, I love it.
Simple question: how do I force a TileList to re-draw its itemRenderers?
Detailed version:
Just to jump in at the deep-end I set myself the following task: I want to extend TileList to make a version which will iterate over all its itemRenderers and call a function on them. This much I've achieved.
I have my extended TileList class, and when I call a specific function, it iterates over all itemRenderers in itself, and calls a function on them. The itemRenderers themselves are just simple componentized image displays with a preloader. The function I'm calling, for the moment, sets the width and height of the itemRenderer via a public method the itemRenderer exposes.
When I run this whole setup, the TileList should iterate over its items, resize them all, and then redraw itself with smaller itemRenderers. It all works except the last bit. I cannot seem to get the damn thing to redraw. If I trace the dimensions of the itemRenderers after the iteration, they've been (theoretically) resized, but they don't visually resize.
I've tried validateNow() and invalidateSize() on the TileList and on each of the itemRenderers. No dice.
Simple question: how do I force a TileList to re-draw its itemRenderers?
Detailed version:
Just to jump in at the deep-end I set myself the following task: I want to extend TileList to make a version which will iterate over all its itemRenderers and call a function on them. This much I've achieved.
I have my extended TileList class, and when I call a specific function, it iterates over all itemRenderers in itself, and calls a function on them. The itemRenderers themselves are just simple componentized image displays with a preloader. The function I'm calling, for the moment, sets the width and height of the itemRenderer via a public method the itemRenderer exposes.
When I run this whole setup, the TileList should iterate over its items, resize them all, and then redraw itself with smaller itemRenderers. It all works except the last bit. I cannot seem to get the damn thing to redraw. If I trace the dimensions of the itemRenderers after the iteration, they've been (theoretically) resized, but they don't visually resize.
I've tried validateNow() and invalidateSize() on the TileList and on each of the itemRenderers. No dice.