HorizontalList requires that all items be the same width and height. At startup, it measures the first one, and uses the measurements for columnWidth and rowHeight.
If you're subclassing, you can set itemsNeedMeasurement=true and call invalidateProperties to force a re-measure and new width/height. I haven't looked at your code yet. It's a busy week for me so I'll wait to hear if you still need me to dig through it. ________________________________ From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Amy Sent: Thursday, April 24, 2008 9:30 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: Tiny components when using callLater() --- In flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com> , "Amy" <[EMAIL PROTECTED]> wrote: > > --- In flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com> , "Alex Harui" <aharui@> wrote: > > > > I'm pretty sure you're not lazy, which is why I'm suggesting that > you > > continue to spend time upgrading your skills at debugging. As your > > applications reach a certain level of sophistication, good debugging > > skills are essential. If someone had an example, they would > provide it, > > but your combination of HList/HBox/Repeater probably isn't common > enough > > for someone to have one handy. > > I notice you didn't step up to "not stupid" LOL. Fair enough :-). > > > I didn't reply to your other post as it seemed like this thread was > > covering both issues. Recycling of renderers has bamboozled lots of > > folks and is usually the cause of problems with the list classes. > The > > HList probably isn't loading its first child several times, > although it > > will use the first dataprovider item to do some measurements before > it > > uses the item to tell a renderer to display it. But the loop that > > generates the renderers for display has been quite thoroughly used > and > > doesn't use the first item twice. I assume you've proven that the > > dataProvider doesn't have the first item in there twice. > > I've uploaded my source code as the most efficient way to show you > why I think that is happening > (ftp://ftp.magnoliamultimedia.com/src.zip <ftp://ftp.magnoliamultimedia.com/src.zip> ). If you get time to look > at it you may find some other explanation of why the trace on line 27 > of GridColumnSolution.mxml runs _twice_ for index zero, but only once > for the other itemrenderers. > > > Anyway, you want to know if the renderer reports the right size. > Try > > something like > > > > > > > > override protected function measure():void > > > > { > > > > super.measure(); > > > > trace("measured", measuredWidth, measuredHeight); > > > > } > > This looks right. > > > override protected function updateDisplayList(w:Number, > h:Number):void > > > > { > > > > trace("udl", w, h); > > > > super.updateDisplayList(w, h) > > > > } > > This is completely wrong (10 and 4 vs. the measured 114 and 238), but > I don't know enough about why to be able to determine what that means. OK, I did some more research, and it seems that this debugging step revealed that my feeling about what was happening is, in fact, correct. The itemRenderer knows exactly how big it is, but the parent container is not allocating it enough space. The question I have been asking all along is "how do I convince the HorizontalList to rethink how much space it is giving my ItemRenderer?" Can anyone out there give me any hints on how to convince a parent container to "grow" to support the new size of its children? It would also be really nice to get some hints on how to get the HorizontalList to load its first child only once, but I can live with the performance hit of having it load twice if there's no way to do this. Thanks; Amy