override protectedfunction updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void { super.updateDisplayList(unscaledWidth, unscaledHeight); var yPos:Number = unscaledHeight; // Temp variable for a container child. var child:UIComponent; var i:int = 0; while(i<this.numChildren) { // Get the first container child. child = UIComponent(getChildAt(i)); // Determine the y coordinate of the child. yPos = yPos - child.height; // Set the x and y coordinate of the child. // Note that you do not change the x coordinate. if(child is ISpecialLayout) { if((child as ISpecialLayout).isSelected) { yPos -= 20; child.move(child.x, yPos); yPos -= 20; }e else { child.move(child.x, yPos); } }e else { child.move(child.x, yPos); } // Save the y coordinate of the child, // plus the vertical gap between children. // This is used to calculate the coordinate // of the next child. yPos = yPos - gap; i++; }i = 0; var amountToCenter:Number = yPos / 2; while(i<this.numChildren) { getChildAt(i).y -= amountToCenter; i++; } } } }