 		
 		protected function stage_resize(event : Event) : void
 		{
-			if ((m_widthIsRelative && m_contentBoxWidth != stage.stageWidth) || 
-				(m_heightIsRelative && m_contentBoxHeight != stage.stageHeight))
+			if (stage && ((m_widthIsRelative && m_contentBoxWidth != stage.stageWidth) || 
+				(m_heightIsRelative && m_contentBoxHeight != stage.stageHeight)))
 			{
 				stageDimensionsChanged = true;
 				invalidateStyles();

		{
			if (m_invalidChildren.length == 0)
			{
				addEventListener(Event.ENTER_FRAME, self_enterFrame);
			}
			//TODO: check if child.toString() is ok to use
			m_invalidChildren.push({element : child, path : child.toString()});


package reprise.ui
{
	import reprise.core.ApplicationContext;
	import reprise.core.FocusManager;
	import reprise.core.UIRendererFactory;
	import reprise.core.reprise;
	import reprise.css.CSS;
	import reprise.css.CSSDeclaration;
	import reprise.debug.DebugInterface;
	import reprise.events.DisplayEvent;

	import flash.display.StageScaleMode;
	import flash.events.Event;
	import flash.utils.getTimer;
	
	use namespace reprise;
