 		}
 		
 		public function Viewport(antiAliasing	: uint	= 0,
+								 stage3dId		: uint	= 0,
 								 width			: uint 	= 0,
 								 height			: uint	= 0)
 		{
+			_stage3dId = stage3dId;
 			_antiAliasing = antiAliasing;
-			
-			if (width == 0 && height == 0)
-				_autoResize = true;
+			_autoResize = width == 0 && height == 0;
 			
 			_width = width;
 			_height = height;

		private var _stage3d			: Stage3D			= null;
		private var _context3d			: Context3DResource	= null;
		
		private var _width				: uint				= 0;
		private var _height				: uint				= 0;
		private var _autoResize			: Boolean			= false;

			
			if (!_stage3d)
			{
				_stage3d = stage.stage3Ds[_stage3dId];
				_stage3d.addEventListener(Event.CONTEXT3D_CREATE, context3dCreatedHandler);
				_stage3d.requestContext3D();
			}
