 
 import mx.core.IFlexDisplayObject;
 import mx.core.IFactory;
+
+import flash.geom.Rectangle;
+import mx.utils.MatrixUtil;
 
 use namespace mx_internal;
 

	private var popUpIsDisplayed:Boolean = false;
	private var addedToStage:Boolean = false;
	
	//--------------------------------------------------------------------------
    //
    //  Properties

		
		var m:Matrix = $transform.concatenatedMatrix;
		
		var popUpWidth:Number = autoSizePopUpWidth ? unscaledWidth : popUp.getPreferredBoundsWidth(false);
		var popUpHeight:Number = autoSizePopUpHeight ? unscaledHeight : popUp.getPreferredBoundsHeight(false);
		
		// Set the dimensions explicitly because UIComponents always set themselves to their
		// measured / explicit dimensions if they are parented by the SystemManager. 
		popUp.width = popUpWidth;
		popUp.height = popUpHeight;
		
		var popUpPoint:Point = positionPopUp();
				
		// Position the popUp. 
		m.tx = popUpPoint.x;
		m.ty = popUpPoint.y;
		popUp.setLayoutMatrix(m,false);
	}
	
