An HBox container with a Button control
<?xml version="1.0"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"> <mx:Script> import mx.controls.Button; public function addButton():void { var myButton:Button = new Button(); myButton.label = "New Button"; myHBox.addChild(myButton); } </mx:Script> <mx:HBox id="myHBox" initialize="addButton();" /> </mx:Application>