Remove control from parent
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"> <mx:HBox width="600" height="400"> <mx:Script> import mx.core.UIComponent; private function hideAndRemoveFromLayout(event:Event):void { (event.target as UIComponent).visible = false; (event.target as UIComponent).includeInLayout = false; } </mx:Script> <mx:VBox> <mx:Button label="Remove from Layout and Hide" click="hideAndRemoveFromLayout(event)" /> </mx:VBox> </mx:HBox> </mx:Application>