 			_atf = null;
 			_bitmapData = null;
 
-			if (_texture == null)
+			if (_resource == null)
 				throw new Error();
 			
-			return _texture;
+			return _resource;
 		}
 		
 		private function uploadTextureWithMipMaps() : void

		private static const FORMAT_BGRA		: String	= Context3DTextureFormat.BGRA
		private static const FORMAT_COMPRESSED	: String	= Context3DTextureFormat.COMPRESSED;
		
		private var _texture	: Texture		= null;
		private var _mipmap		: Boolean		= false;

		private var _bitmapData	: BitmapData	= null;


		public function getNativeTexture(context : Context3DResource) : TextureBase
		{
			if ((!_resource || _resize) && _width && _height)
			{
				_resize = false;
				
				if (_resource)
					_resource.dispose();
				
				_resource = context.createTexture(
					_width,
					_height,
					_atf && _atfFormat == 2 ? FORMAT_COMPRESSED : FORMAT_BGRA,
