     //  Layout
     //
     //--------------------------------------------------------------------------
-    
+  
     protected function initializeLayoutObject():void
     {
-        if (_layoutClass == null)
-            _layout = new BasicLayout();
-        else
-            _layout = new _layoutClass();
-        
-        _layout.target = this;
+		if (_layout == null) {
+			_layout = (_layoutClass) ? new _layoutClass() : new BasicLayout();
+		}
+        ILayout(_layout).target = this;
             
         invalidateSize();
         invalidateDisplayList();
     }
+
     
     //--------------------------------------------------------------------------
     //

            UIComponent(parent).invalidateDisplayList();
        }
    }
    
        //--------------------------------------------------------------------------
    //
    //  Properties: Overriden Focus management
    //

        return _content;
    }
    
    public function get layout():Object
    {
    	return _layout;
    }

    // TBD: HACK for the sake of getDefinitionByName
    private static const forceLoad0:Class = flex.layout.BasicLayout;
    private static const forceLoad1:Class = flex.layout.HorizontalLayout;
    private static const forceLoad2:Class = flex.layout.VerticalLayout;
     
    public function set layout(value:Object):void
    {
    	if (value is ILayout) {
    		_layout = ILayout(value);
    	    _layoutClass = null;
    	}
    	else if (value is String) {
    		_layout = null;
		    _layoutClass = flash.utils.getDefinitionByName(String(value)) as Class;
    	}
    	else if (value is Class) {
    		_layout = null;
    		_layoutClass = Class(value);
    	}
    	else {
    		_layout = null;
    		_layoutClass = null;
    	}
        layoutChanged = true;
        invalidateProperties();    	
    }


    protected function initializeChildrenArray():void
    {   
