DividedBox Subclass Doesn't Work as Child of UIComponent

Hello,

let me explain how. I tired to isolate the problem in my project so its limited to this:

class Holder: UIComponent subclass, the only thing it does is create an instance of DividedBoxTest and add it to its displaylist

public function Holder()
{
    super();
    
    addChild ( new DividedBoxTest () );
}

class DividedBoxTest: Nothing but a subclass of DividedBox that adds few children to itself as some content

public function DividedBoxTest()
{
    super();
            
    addChild ( new Button () );
    addChild ( new Button () );
}

I also have a css file with this:

DividedBoxTest
{
    background-color : #ff0000;
    left : 0;
    right : 0;
    top : 0;
    bottom : 0;
}

Holder
{
    background-color : #00ff00;
    left : 0;
    right : 0;
    top : 0;
    bottom : 0;
}

So nothing that wouldn’t be alright to my understandings.

Now in my application mxml file upon applicationComplete event, I call either

addChild ( new Holder () )

or

addChild ( new DividedBoxTest () )

Simple instance of DividedBoxTest works great, but if I create an instance of Holder, nothing gets displayed.

I was playing with it in my project and the debugger showed that all children were created, added etc., but the DividedBox subclass had zero width and height. When I tried to sets its size, it worked, but only in something like

var box : DividedBoxTest = new DividedBoxTest ()
box.width = 500;
box.height = 200;

and if I would try to set its size in Holders updateDisplayList, it would seem that it showed the background, but the rest was still at zero size as no children were visible.

Does anybody know why this would happen? Why it won’t size properly by itself, ignore left/right/etc? It doesn’t seem as I’m doing anything wrong :frowning:

Thanks for any help.