I have a component ObjectHolder
which extends UIComponent
that holds many children UIComponents
. However, after using addChild()
to add these children to ObjectHolder
, its width and height remain zero. Is it possible for the UIComponent
to automatically expand to the size of its containing children components?
public class ObjectHolder extends UIComponent
{
public function ObjectHolder()
{
var c1:UIComponent = new UIComponent();
c1.graphics.beginFill( 0xffffff );
c1.graphics.drawRect(0, 0, 100, 100);
addChild( c1 );
trace( this.width ); // Displays zero
}
}