Flex uses an invalidation mechanism.  As properties change, flags are
set requesting validation of those properties at a later time.  You can
force validation by calling validateNow(), but it can be expensive.

________________________________

From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of Justin Winter
Sent: Tuesday, November 27, 2007 9:10 AM
To: [email protected]
Subject: [flexcoders] This has to be a bug right? If not, please
explain...



added to a creationComplete handler function:

<code>
var vBox:VBox = new VBox();

for(var i:int = 0; i < 10; i++)
{
var tmpBtn:Button = new Button();
tmpBtn.label = "BUTTON: " + i;
vBox.addChild(tmpBtn); 
}

this.addChild(vBox);

trace('VBOX HEIGHT: ' + vBox.height);
</code>

OUTPUT:
------
VBOX HEIGHT: 0 <- ALWAYS ZERO

No matter if I call vBox.invalidateProperties(); or any of the other
invalidate functions. The buttons are added to the container fine and
are displayed fine. 

I've also tried this with several other containers and the height is
not updated after the children are added. What am I missing here? 



 

Reply via email to