I would use UIComponent instead of VBox and create and layout your Buttons using custom code. 200 buttons should be ok. You're probably being killed by the overhead of containers thinking about all of those Buttons. With UIComponent you'll have to write a bit more code, but only the code you need, so it should be faster. See ListItemRenderer.as for example of UIComponent-based renderer
From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Thierry Thelliez Sent: Tuesday, November 04, 2008 11:16 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] itemRenderer optimization: replacing VBoxes containing Buttons? Hello, I have implemented my first FLEX page! But I am having performance problems when my AdvancedDataGrid contains a larger number of rows and columns. I am trying to generate some sort of Gantt Chart, with the difference that the cells are drawn vertically. Each cell contains a dynamic number of buttons. And each buttons have a dynamic height representing some data (like a bar chart). Each button links to a different URL to drill down the data (in a separate page). This also means that the rows height is dynamic. My first (naive) implementation used an itemRenderer implemented in MXML with a VBox and some dynamically generated Buttons. It works great with few rows and columns. But with real data (~ 20 rows and ~ 50 columns) the whole page is too slow. In average, there is about 200 buttons to be generated. Many cells are empty, while some contains one or more buttons. I read the canvas should be avoided (http://blogs.adobe.com/aharui/2007/03/thinking_about_item_renderers_1.html). What should I do in my case? Do I need to manually draw some rectangles and catch click events? Thanks, Thierry