 		
 		// non-top level system managers may not be able to reference their parent if
 		// they are a proxy for popups.
-		if (!systemManager.topLevel && systemManager.parent)
+		if (!topLevel && DisplayObject(systemManager).parent)
 		{
 			// non-topLevel SystemManagers are buried by Flash.display.Loader and
 			// other non-framework layers so we have to figure out the nestlevel
 			// by searching up the parent chain.
-			var obj:DisplayObjectContainer = systemManager.parent.parent;
+			var obj:DisplayObjectContainer = DisplayObject(systemManager).parent.parent;
 			while (obj)
 			{
 				if (obj is ILayoutManagerClient)

		}
 	}

}

}

			// Pass the application instance to the preloader.
			// Note: preloader can be null when the user chooses
			// Control > Play in the standalone player.
			if (preloader)
				preloader.registerApplication(app);
						
			// The Application doesn't get added to the SystemManager in the standard way.
			// We want to recursively create the entire application subtree and process
