Measure() is called on Canvas as well because a Canvas's measuredWidth/Height are dictated by the position and size of its children.
You should always measure your children in the measure() method, and position them in updateDisplayList. Anything you do in creationComplete can cause something to be invalidated and cause another pass of commitProperties/measure/updateDisplayList. I'm not sure what you mean by "attached to invalidateDisplayList". It is possible to create invalidation loops where by the time we finish validating, something is invalidated again. ________________________________ From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Josh McDonald Sent: Tuesday, May 13, 2008 5:54 PM To: [email protected] Subject: Re: [flexcoders] Quick question - who calls UIComponent.measure()? If it's in a container that uses a LayoutManager (not Canvas IIRC), and if the component in question isn't of a fixed size. If you need to measure and position stuff in a component that's not always of a fluid size, you need to move your code into another method, and call it both from measure() and on CreationComplete and whenever you add a component. I'm not sure if it could be attached to invalidateDisplayList somehow, in case you do something that triggers an endless loop ;-) It's something I'll look into when I have more time, as I'm doing all my component adding in createChildren() and haven't had to deal with post CreationComplete changes. Alex, please correct me if I'm wrong in there somewhere, too! -J On Wed, May 14, 2008 at 10:18 AM, Mansour Raad <[EMAIL PROTECTED]> wrote: Question - is it part of the lifecycle of the component ? Mansour :-) -----Original Message----- From: [email protected] <mailto:flexcoders%40yahoogroups.com> on behalf of Alex Harui Sent: Tue 5/13/2008 8:07 PM To: [email protected] <mailto:flexcoders%40yahoogroups.com> Subject: RE: [flexcoders] Quick question - who calls UIComponent.measure()? It is called by LayoutManager via validateSize() ________________________________ From: [email protected] <mailto:flexcoders%40yahoogroups.com> [mailto:[email protected] <mailto:flexcoders%40yahoogroups.com> ] On Behalf Of Josh McDonald Sent: Tuesday, May 13, 2008 4:33 PM To: [email protected] <mailto:flexcoders%40yahoogroups.com> Subject: [flexcoders] Quick question - who calls UIComponent.measure()? Hey guys, Since UIComponent.measure() is protected, does the container invoke it via a round-about way, or is it simply called from a ResizeEvent.RESIZE handler somewhere in UIComponent? -J -- "Therefore, send not to know For whom the bell tolls. It tolls for thee." :: Josh 'G-Funk' McDonald :: 0437 221 380 :: [EMAIL PROTECTED] <mailto:josh%40gfunk007.com> <mailto:[EMAIL PROTECTED] <mailto:josh%40gfunk007.com> > -- "Therefore, send not to know For whom the bell tolls. It tolls for thee." :: Josh 'G-Funk' McDonald :: 0437 221 380 :: [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>

