Let’s say you have a Label and you want to show this label only when condition == true, you may do this:
<mx:VBox> ... other components ... <mx:Label text="this is label" visible="{condition}"/> ... other components ... </mx:VBox>
But you will find your invisible Label still takes its space. Then you may try something like
<mx:VBox> ... other components ... <mx:Label text="this is label" visible="{condition}" height="{condition?20:0}" /> ... other components ... </mx:VBox>
Then you need to know the exact height of Label (20 is a good guess but not exact).
The ultimate solution is to use includeInLayout and visible (Yes, you need specify both visible and includeInLayout)
<mx:VBox> ... other components ... <mx:Label text="this is label" visible="{condition}" inclueInLayout="{condition}" /> ... other components ... </mx:VBox>
related links: an example