I've this situation:
A main component where root node is .
In this VBox I explicit the property verticalGap = "0".
In the creation complete, I add a lot of components, in this way:
var pnlFirstCmp:PnlFirstCmp = new PnlFirstCmp();
this.addElement(pnlFirstCmp);
for (var i:int = 1; i<myArray.length; i++) {
var pnlOtherCmp:PnlOtherCmp = new PnlOtherCmp();
this.addElement(pnlOtherCmp);
}
var pnlFooter:PnlFooter = new PnlFooter();
this.addElement(pnlFooter);
Now, problem is:
when I see my panel there are some spaces among the different panel that I added at runtime.
Where I'm wrong!?!?!?
EDIT AFTER COMMENT:
My root node:
<mx:VBox xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx" width="100%" height="100%"
creationComplete="vbox1_creationCompleteHandler(event)"
verticalGap="0">
Creation complete:
protected function vbox1_creationCompleteHandler(event:FlexEvent):void
{
createPanel();
}
PnlFirstCmp (node root):
<mx:VBox xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx" width="100%" height="100%"
verticalGap="0">
PnlOtherCmp (node root):
<mx:VBox xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx" width="100%" height="100%"
verticalGap="0">
PnlFooter (node root):
<mx:VBox xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx" width="100%" height="100%" verticalGap="0">
If you want show other bit of codes, don't esitate ;)