> Nope, it doesn't. It returns 0.
> If you use callLater, all values are returned correctly.

Hi, I didn't test the example and what I wrote is correct theory. ... now I have.

Really I have made some very complicated stuff with components and have never had to use 'callLater()'.

The problem is he is calling validateNow() on the text.

change

textViaAS.validateNow(); // really just for kicks, it doesn't

to

validateNow(); // really just for kicks, it doesn't

and you will see the trace

nulltextViaMXML.width = 255
textViaMXML.measuredWidth = 255
textViaMXML.textWidth = 97
textViaAS.width = 306
textViaAS.measuredWidth = 306
textViaAS.textWidth = 97

This is becasue you are now calling validateNow() on the Application component.

Anyway, what he is doing is going against the grain. I don't think he fully understands what 'width' is. In this case measuredWidth IS the width since you didn't explictly call width.

The ONLY reason width is even set in the 'callLater()' pass is becasue the Application set the width in it's setActualSize() call ON the Text component by USING the Text component's measuredWidth property. ;-)

:) This takes a little mind bending to understand. width property doens not always mean something. It depends on the contenxt metrics of the component's state.

Peace, Mike

PS Everything is working the way it is supposed to, again, width is not 'god' anymore. measuredWidth is.


On 9/2/06, Muzak <[EMAIL PROTECTED]> wrote:


----- Original Message -----
From: "Michael Schmalle" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Saturday, September 02, 2006 5:27 AM
Subject: Re: [flexcoders] UIComponent.width is always 0

> Hi,
>
> Not to step on toes here but...
>
> The reason is not that a 'width' is not getting set but explicitWidth has
> not been set by YOU.
>
> If you call text.getExplicitOrMeasuredWidth(), this will return the correct
> measurement.

Nope, it doesn't. It returns 0.
If you use callLater, all values are returned correctly.

regards,
Muzak




--
What goes up, does come down. __._,_.___

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com





SPONSORED LINKS
Software development tool Software development Software development services
Home design software Software development company


YAHOO! GROUPS LINKS




__,_._,___

Reply via email to