I think you need to call validateNow() on the component's parent. - Gordon
________________________________ From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Daniel Sent: Sunday, September 23, 2007 11:23 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: Real size of components Hey guys... this.validateNow() doesn't work... the width property doesn't refresh after that call... and the listener for the updateComplete Event wouldn't work much for me, because i'm laying out the panels and I need the width and height immediatly... Is there any way to get the size immediatly? I could use the updateComplete handler, but rather leave it as a last choice... Thanx a lot, DaNooB --- In flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com> , "Alex Harui" <[EMAIL PROTECTED]> wrote: > > Use validateNow() or validateClient(). ValidateSize is for internal use > by the framework and calling it by itself isn't guaranteed to work. > > > > ________________________________ > > From: flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com> [mailto:flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com> ] On > Behalf Of Arpit Mathur > Sent: Saturday, September 22, 2007 11:49 AM > To: flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com> > Subject: Re: [flexcoders] Re: Real size of components > > > > Would this work? > > > > component.percentWidth = 50 > > component.percentHeight = 50 > > component.validateSize() > > trace(component.measuredWidth) > > > > I have never really used the validation thing so I am curious. Its how I > would imagine it would work. > > > > > > On 9/21/07, Gordon Smith <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> > > wrote: > > It sounds like you are expecting to set percentWidth and immediately > have the width change. Flex visual components don't work like this. > Typically when you set properties, the component enters a kind of > "invalid" state until the LayoutManager updates it. If you wait until > the component dispatches an updateComplete event, the width should then > be correct. > > > > - Gordon > > > > > ________________________________ > > From: flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com> <http://ups.com/> [mailto: flexcoders@ > <mailto:flexcoders@> yahoogroups.com <http://yahoogroups.com <http://yahoogroups.com> > ] On > Behalf Of Sandeep Malik > Sent: Friday, September 21, 2007 6:57 AM > To: [EMAIL PROTECTED] ups.com <http://ups.com/> > Subject: [flexcoders] Re: Real size of components > > > > I guess you should use getExplicitOrMeasuredWidth() and > getExplicitOrMeasuredHeight(). > > Regards, > Sandeep > > --- In flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com> <mailto:flexcoders%40yahoogroups.com> > , "ben.clinkinbeard" > <ben.clinkinbeard@> wrote: > > > > measuredWidth and measuredHeight I think. > > > > > > --- In flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com> > <mailto:flexcoders%40yahoogroups.com> , "Daniel" <danielterraza@> wrote: > > > > > > Hey guys... > > > > > > I'm setting the size of a panel through the percentWidth property, > but > > > when I ask for the width of the component it doesn't give me the > real > > > size... How can I know the real size when I set width and height > > > through percentage? > > > > > > Thanx, > > > DaNooB. > > > > > > > > > > -- > Arpit Mathur > Lead Software Engineer, > Comcast Interactive Media > --------------------------------------- > post your flex tips on > http://flextips.corank.com <http://flextips.corank.com> <http://flextips.corank.com <http://flextips.corank.com> > >