I am adding child as:
containerComponent.addChild(newComponent);
But, it adds it as last child. How can I add newComponent as first child of containerComponent?
I am adding child as:
containerComponent.addChild(newComponent);
But, it adds it as last child. How can I add newComponent as first child of containerComponent?
Use addChildAt instead of addChild with the index parameter set to 0:
containerComponent.addChildAt(newComponent, 0);