     override public function createComponentsFromDescriptors(
                                 recurse:Boolean = true):void
     {
+        inCreateComponentsFromDescriptors = true;
         super.createComponentsFromDescriptors();
         
         if (numChildren == 0)
         {
             setControlBar(null);
+            inCreateComponentsFromDescriptors = false;
             return;
         }
         

        {
            setControlBar(null);
        }
    }

    //--------------------------------------------------------------------------
    //
    //  Methods

            }
            else
            {
                super.removeChild(DisplayObject(lastChild));
            }       
            // Restore the original document. Otherwise, when we re-add the child when the Panel is
            // a custom component, the child will use the custom component as the document instead of
