Re: [flexcoders] UIComponent.width is always 0
Sorry, that's not correct.. try using a timer..Ok, I'm done with this and not going to argue.Why don't you take a look at the LayoutManager code and look at the validateClient() code.timming a method that loops through stuff like that method does means nothing. The only thing that proves anything is actually looking at framework code. - obj.validateDisplayList();The line above is one af the many validate... methods found in validateClient(). The validateDisplayList() method calls updateDisplayList(), so what you are saying dosn't make sense. The purpose of validateClient() is to run through ALL of the validation stacks of the LayoutManager. The reason this method might make you think it is waiting a frame is sometimes calling a method like - obj.validateProperties();Will cause another component to be added to the stack. The methods docs also say... It updates all properties in all components whose nest level is greater than or equalto the target component before returning. Call this method only when necessary as it is a computationally intensive call Thanks for the discussion. ;-)Peace, MikeOn 9/2/06, Muzak [EMAIL PROTECTED] wrote: - Original Message - From: Michael Schmalle [EMAIL PROTECTED] To: flexcoders@yahoogroups.com Sent: Saturday, September 02, 2006 2:35 PM Subject: Re: [flexcoders] UIComponent.width is always 0 Hi, I don't know where this is going but, Really there is no issue here. He wanted width, he got width instantly with measuredWidth., end subject. BTW validateNow() instantly validates, no frame pass or anything. Sorry, that's not correct.. try using a timer.. 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 Visit your group "flexcoders" on the web. To unsubscribe from this group, send an email to:[EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. __,_._,___
Re: [flexcoders] UIComponent.width is always 0
I tested the code before, without the validateNow on the the text instance, so that wasn't bothering me. When you call validateNow() on the application I guess you get the same result as with callLater() because validateNow() takes 'a frame' to execute, thus the code after that (the debug text) is delayed/executed later. Hope that makes sense.. I understand what you mean by things being different in Flex, but I think that's not really relevant here. The thing is that text properties do not have the 'correct' value immediatly when added to the display list through actionscript. regards, Muzak - Original Message - From: Michael Schmalle [EMAIL PROTECTED] To: flexcoders@yahoogroups.com Sent: Saturday, September 02, 2006 6:54 AM Subject: Re: [flexcoders] UIComponent.width is always 0 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. -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com Yahoo! Groups Links * To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ * To unsubscribe from this group, send an email to: [EMAIL PROTECTED] * Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
Re: [flexcoders] UIComponent.width is always 0
Hi,I don't know where this is going but,Really there is no issue here. He wanted width, he got width instantly with measuredWidth., end subject.BTWvalidateNow() instantly validates, no frame pass or anything. layoutManager.validateClient(this);This just seems to be a theoretical misunderstanding and somehow I think Flash is to blame. :)The question truly becomes, why do you want to know the width 2 lines after you call addChild() when you didn't set it! The measuredWIdth property of the Text component IS the width until you explictly set the width property of the Text component. This is why in component development, you call composite.getExplicitOrMeasuredWidth(). That method then wraps the decision to either get width or explicitWidth(if have been set by you) OR measured with if those are not set. Peace, MikePS reread my last two posts, I say the same thing.On 9/2/06, Muzak [EMAIL PROTECTED] wrote: I tested the code before, without the validateNow on the the text instance, so that wasn't bothering me. When you call validateNow() on the application I guess you get the same result as with callLater() because validateNow() takes 'a frame' to execute, thus the code after that (the debug text) is delayed/executed later. Hope that makes sense.. I understand what you mean by things being different in Flex, but I think that's not really relevant here. The thing is that text properties do not have the 'correct' value immediatly when added to the display list through actionscript. regards, Muzak - Original Message - From: Michael Schmalle [EMAIL PROTECTED] To: flexcoders@yahoogroups.com Sent: Saturday, September 02, 2006 6:54 AM Subject: Re: [flexcoders] UIComponent.width is always 0 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. -- 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 Visit your group "flexcoders" on the web. To unsubscribe from this group, send an email to:[EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. __,_._,___
Re: [flexcoders] UIComponent.width is always 0
If I could just say one more thing here, maybe it would clear up some confussion.In Flash v2, Flex 1.5 you had _width._width was a property of the player that you could not override. Now in AS3, _width has changed to width and the meaning is still the same for DisplayObjects. width is not the same for the flex framework. Now you can override width and that is what Adobe did, they overrode it and added wrapper proxies to it. They have implemented their own _width property but, that only stores the explicit width set by a client. width in the flex frameowrk no longer means the actual player width of the DisplayObject now UIComponent. A UIComponent now delegates it's metrics to width, explicitWidth and measuredWidth.This override and new rules are needed to create flexable layouts in the flex framework. Now, width just means 'the client set me to this and don't use me measuredWidth calculated in measure()' This is a huge problem a lot of developers are dealing with when migrating from as2,Fash, Flex 1.5 to as3 flex framework(UIComponent).So here again, width does not mean width as it pertains to a Sprite. Instead of the Flash player delegating a DisplayObject's dimensions, the flex framework overrides that responsibility. This is also why anything that has to be added in a container(which all Flex apps are a part of ala Application is the root instance in a Flex2 app) has to implement IFlexDisplayObject.The theory here is that IFlexDisplayObject then adds the needed measuredWidth, explicitWidth for a capable component to have itself perform the needed calculations for proper display in a Container, not Sprite. I have written a lot about this and a huge book is coming on my web site talking about all this.Peace, MikeOn 9/2/06, Michael Schmalle [EMAIL PROTECTED] wrote: Hi,I don't know where this is going but,Really there is no issue here. He wanted width, he got width instantly with measuredWidth., end subject.BTWvalidateNow() instantly validates, no frame pass or anything. layoutManager.validateClient(this);This just seems to be a theoretical misunderstanding and somehow I think Flash is to blame. :)The question truly becomes, why do you want to know the width 2 lines after you call addChild() when you didn't set it! The measuredWIdth property of the Text component IS the width until you explictly set the width property of the Text component. This is why in component development, you call composite.getExplicitOrMeasuredWidth(). That method then wraps the decision to either get width or explicitWidth(if have been set by you) OR measured with if those are not set. Peace, MikePS reread my last two posts, I say the same thing.On 9/2/06, Muzak [EMAIL PROTECTED] wrote: I tested the code before, without the validateNow on the the text instance, so that wasn't bothering me. When you call validateNow() on the application I guess you get the same result as with callLater() because validateNow() takes 'a frame' to execute, thus the code after that (the debug text) is delayed/executed later. Hope that makes sense.. I understand what you mean by things being different in Flex, but I think that's not really relevant here. The thing is that text properties do not have the 'correct' value immediatly when added to the display list through actionscript. regards, Muzak - Original Message - From: Michael Schmalle [EMAIL PROTECTED] To: flexcoders@yahoogroups.com Sent: Saturday, September 02, 2006 6:54 AM Subject: Re: [flexcoders] UIComponent.width is always 0 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
Re: [flexcoders] UIComponent.width is always 0
Haha, just adding fuel to the fire but,To make things even more crazy;-) When you set percentWidth to anything above 0, the witdth property of a UIComponent then becomes NaN. I think this proves the theory of what I am saying. Peace, MikeOn 9/2/06, Michael Schmalle [EMAIL PROTECTED] wrote: If I could just say one more thing here, maybe it would clear up some confussion.In Flash v2, Flex 1.5 you had _width._width was a property of the player that you could not override. Now in AS3, _width has changed to width and the meaning is still the same for DisplayObjects. width is not the same for the flex framework. Now you can override width and that is what Adobe did, they overrode it and added wrapper proxies to it. They have implemented their own _width property but, that only stores the explicit width set by a client. width in the flex frameowrk no longer means the actual player width of the DisplayObject now UIComponent. A UIComponent now delegates it's metrics to width, explicitWidth and measuredWidth.This override and new rules are needed to create flexable layouts in the flex framework. Now, width just means 'the client set me to this and don't use me measuredWidth calculated in measure()' This is a huge problem a lot of developers are dealing with when migrating from as2,Fash, Flex 1.5 to as3 flex framework(UIComponent).So here again, width does not mean width as it pertains to a Sprite. Instead of the Flash player delegating a DisplayObject's dimensions, the flex framework overrides that responsibility. This is also why anything that has to be added in a container(which all Flex apps are a part of ala Application is the root instance in a Flex2 app) has to implement IFlexDisplayObject.The theory here is that IFlexDisplayObject then adds the needed measuredWidth, explicitWidth for a capable component to have itself perform the needed calculations for proper display in a Container, not Sprite. I have written a lot about this and a huge book is coming on my web site talking about all this.Peace, MikeOn 9/2/06, Michael Schmalle [EMAIL PROTECTED] wrote: Hi,I don't know where this is going but,Really there is no issue here. He wanted width, he got width instantly with measuredWidth., end subject.BTWvalidateNow() instantly validates, no frame pass or anything. layoutManager.validateClient(this);This just seems to be a theoretical misunderstanding and somehow I think Flash is to blame. :)The question truly becomes, why do you want to know the width 2 lines after you call addChild() when you didn't set it! The measuredWIdth property of the Text component IS the width until you explictly set the width property of the Text component. This is why in component development, you call composite.getExplicitOrMeasuredWidth(). That method then wraps the decision to either get width or explicitWidth(if have been set by you) OR measured with if those are not set. Peace, MikePS reread my last two posts, I say the same thing.On 9/2/06, Muzak [EMAIL PROTECTED] wrote: I tested the code before, without the validateNow on the the text instance, so that wasn't bothering me. When you call validateNow() on the application I guess you get the same result as with callLater() because validateNow() takes 'a frame' to execute, thus the code after that (the debug text) is delayed/executed later. Hope that makes sense.. I understand what you mean by things being different in Flex, but I think that's not really relevant here. The thing is that text properties do not have the 'correct' value immediatly when added to the display list through actionscript. regards, Muzak - Original Message - From: Michael Schmalle [EMAIL PROTECTED] To: flexcoders@yahoogroups.com Sent: Saturday, September 02, 2006 6:54 AM Subject: Re: [flexcoders] UIComponent.width is always 0 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
Re: [flexcoders] UIComponent.width is always 0
- Original Message - From: Michael Schmalle [EMAIL PROTECTED] To: flexcoders@yahoogroups.com Sent: Saturday, September 02, 2006 2:35 PM Subject: Re: [flexcoders] UIComponent.width is always 0 Hi, I don't know where this is going but, Really there is no issue here. He wanted width, he got width instantly with measuredWidth., end subject. BTW validateNow() instantly validates, no frame pass or anything. Sorry, that's not correct.. try using a timer.. regards, Muzak -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com Yahoo! Groups Links * To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ * To unsubscribe from this group, send an email to: [EMAIL PROTECTED] * Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
Re: [flexcoders] UIComponent.width is always 0
Sounds like you're running into the 'one-frame-delay-thing' that is known to most Flash users. Try using callLater() and see if that fixes it, or use one of the events, such as 'add', 'added', 'creationComplete', 'updateComplete', 'resize'.. Not sure which one will be triggered at the right moment, so you'll have to test it. regards, Muzak - Original Message - From: munkydung [EMAIL PROTECTED] To: flexcoders@yahoogroups.com Sent: Saturday, September 02, 2006 1:08 AM Subject: [flexcoders] UIComponent.width is always 0 Well, not always... When I instantiate a control with an MXML tag, the width property returns the correct number. When I instantiate a control via ActionScript, the width property always returns 0. What am I doing wrong? Here's the code ?xml version=1.0 encoding=utf-8? mx:Application layout=absolute width=100% height=100% frameRate=12 pageTitle=Text Control width test xmlns:mx=http://www.adobe.com/2006/mxml; creationComplete=init() mx:Script ![CDATA[ import mx.controls.Text; [Bindable] internal var debugMsg:String; // used for displaying text our textArea at the bottom of the application internal function init():void { // output widths of text control created via MXML debugMsg += textViaMXML.width = + textViaMXML.width + \n; debugMsg += textViaMXML.measuredWidth = + textViaMXML.measuredWidth + \n; debugMsg += textViaMXML.textWidth = + textViaMXML.textWidth + \n; // now we create a Text via actionscript var textViaAS:Text = new Text(); textViaAS.text = Text Control created via ActionScript; textViaAS.y = 40; textViaAS.setStyle('horizontalCenter',0); application.addChild(textViaAS); textViaAS.validateNow(); // really just for kicks, it doesn't seem to fix the problem... // output widths of text element created via ActionScript debugMsg += textViaAS.width = + textViaAS.width + \n; debugMsg += textViaAS.measuredWidth = + textViaAS.measuredWidth + \n; debugMsg += textViaAS.textWidth = + textViaAS.textWidth + \n; } ]] /mx:Script mx:Style Text { fontFamily: Verdana; fontSize: 16pt; } TextArea.debugTextArea { fontFamily: Courier; fontSize: 12pt; } /mx:Style mx:Text id=textViaMXML text=Text Control created via MXML horizontalCenter=0/ !-- a textArea for display messages from AS -- mx:ApplicationControlBar id=debugControlBar dock=false width=100% bottom=0 mx:TextArea id=debugTextArea styleName=debugTextArea width=100% height=120 editable=false text={debugMsg} / /mx:ApplicationControlBar /mx:Application -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com Yahoo! Groups Links * To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ * To unsubscribe from this group, send an email to: [EMAIL PROTECTED] * Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
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. Now, if you set text.width OR text.explicitWidth, you will get text.width. ;-) This locks the component in a flow layout though.Imagine;- explicit (set by the client) [width] [explicitWidth]- measure (measured by the component) :: [measuredWidth] min maxwidth also then gets set by calling setActualSize() which a container such as the Application does(Box).There is nothing wrong here and everything is completly the way it is supposed to be. This shows what is going on when MXML is involved.text.setActualSize(text.getExplicitOrMeasuredWidth(), text.getExplicitOrMeasuredHeight())Anyway, width does not mean _width anymore. Everything is based on real things now, no boundingBoxes, (and thankgoodness for that). Peace, MikeOn 9/1/06, Muzak [EMAIL PROTECTED] wrote: Sounds like you're running into the 'one-frame-delay-thing' that is known to most Flash users. Try using callLater() and see if that fixes it, or use one of the events, such as 'add', 'added', 'creationComplete', 'updateComplete', 'resize'.. Not sure which one will be triggered at the right moment, so you'll have to test it. regards, Muzak - Original Message - From: munkydung [EMAIL PROTECTED] To: flexcoders@yahoogroups.com Sent: Saturday, September 02, 2006 1:08 AM Subject: [flexcoders] UIComponent.width is always 0 Well, not always... When I instantiate a control with an MXML tag, the width property returns the correct number. When I instantiate a control via ActionScript, the width property always returns 0. What am I doing wrong? Here's the code ?xml version=1.0 encoding=utf-8? mx:Application layout=absolute width=100% height=100% frameRate=12 pageTitle=Text Control width test xmlns:mx=http://www.adobe.com/2006/mxml creationComplete=init() mx:Script ![CDATA[ import mx.controls.Text; [Bindable] internal var debugMsg:String; // used for displaying text our textArea at the bottom of the application internal function init():void { // output widths of text control created via MXML debugMsg += textViaMXML.width = + textViaMXML.width + \n; debugMsg += textViaMXML.measuredWidth = + textViaMXML.measuredWidth + \n; debugMsg += textViaMXML.textWidth = + textViaMXML.textWidth + \n; // now we create a Text via actionscript var textViaAS:Text = new Text(); textViaAS.text = Text Control created via ActionScript; textViaAS.y = 40; textViaAS.setStyle('horizontalCenter',0); application.addChild(textViaAS); textViaAS.validateNow(); // really just for kicks, it doesn't seem to fix the problem... // output widths of text element created via ActionScript debugMsg += textViaAS.width = + textViaAS.width + \n; debugMsg += textViaAS.measuredWidth = + textViaAS.measuredWidth + \n; debugMsg += textViaAS.textWidth = + textViaAS.textWidth + \n; } ]] /mx:Script mx:Style Text { fontFamily: Verdana; fontSize: 16pt; } TextArea.debugTextArea { fontFamily: Courier; fontSize: 12pt; } /mx:Style mx:Text id=textViaMXML text=Text Control created via MXML horizontalCenter=0/ !-- a textArea for display messages from AS -- mx:ApplicationControlBar id=debugControlBar dock=false width=100% bottom=0 mx:TextArea id=debugTextArea styleName=debugTextArea width=100% height=120 editable=false text={debugMsg} / /mx:ApplicationControlBar /mx:Application -- 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 Visit your group "flexcoders" on the web. To unsubscribe from this group, send an email to:[EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. __,_._,___
Re: [flexcoders] UIComponent.width is always 0
- Original Message - From: Michael Schmalle [EMAIL PROTECTED] To: flexcoders@yahoogroups.com 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 -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com Yahoo! Groups Links * To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ * To unsubscribe from this group, send an email to: [EMAIL PROTECTED] * Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
Re: [flexcoders] UIComponent.width is always 0
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.changetextViaAS.validateNow(); // really just for kicks, it doesn'ttovalidateNow(); // really just for kicks, it doesn't and you will see the tracenulltextViaMXML.width = 255textViaMXML.measuredWidth = 255textViaMXML.textWidth = 97textViaAS.width = 306textViaAS.measuredWidth = 306textViaAS.textWidth = 97This 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, MikePS 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: flexcoders@yahoogroups.com 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 Visit your group "flexcoders" on the web. To unsubscribe from this group, send an email to:[EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. __,_._,___