 		
 		private function updateRectangle() : void
 		{
-			if (_context)
+			if (_stage3d)
 			{
 				var origin : Point = localToGlobal(ZERO2);
 				
-				stage.stage3Ds[0].viewPort = new Rectangle(origin.x, origin.y, _width, _height);
+				_stage3d.viewPort = new Rectangle(origin.x, origin.y, _width, _height);
 			}
 		}
 		

			}
			
			showLogo();
		}
		
		private function stageResizeHandler(event : Event) : void

			if (stage.stageHeight)
				height = stage.stageHeight;
			
			resetStage3D();
		}
		
		private function contextCreatedHandler(event : Event) : void
		{
			_stage3d = stage.stage3Ds[0];
			
			resetStage3D();
		}
		
		private function resetStage3D(event : Event = null) : void
		{
			if (_stage3d)
			{
				updateRectangle();
				_stage3d.context3D.configureBackBuffer(_width, _height, _aa, true);
				
				_renderer = new DirectRenderer(this, _stage3d.context3D);
				
				_wdExtracterQuery = new WorldDataExtracterVisitor();
				_renderingQuery = new RenderingVisitor(_renderer);
