there are several ways you can do this, my personal favorite is through the skin so that way if I already have several panels I want to apply the effect to I just set the skin.
I have attached a very simple project that opens and closes a panel with a button,
All I did was reduce the minheight of the component to 30 created a button on the title bar , added a variable to hold the original height and a click event for the button
protected function expandBtn_clickHandler(event:MouseEvent):void
if (hostComponent.height == fullHeight) hostComponent.height = 32 else hostComponent.height=fullHeight;
That's great. Thank you for your time!