 		
 		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();

			m_rootElement = this;
			m_containingBlock = this;
			m_invalidChildren = [];
			stage.addEventListener(Event.RESIZE, stage_resize);
			super.initialize();
			stage.stageFocusRect = false;
			m_focusManager = new FocusManager(this);
			
			m_debugInterface = new DebugInterface(this);
		}
		
		protected override function initDefaultStyles() : void
		{
			m_elementDefaultStyles.setStyle('width', '100%');

			removeEventListener(Event.ENTER_FRAME, self_enterFrame);
			validateElements();
		}
		
		protected function self_removedFromStage(event : Event) : void
		{
			removeEventListener(Event.ENTER_FRAME, self_enterFrame);
			stage.removeEventListener(Event.RESIZE, stage_resize);
		}
	}
}