 					while (size >= 1)
 					{
 						tmp.draw(_bitmapData, transform, null, null, null, true);
-						_texture.uploadFromBitmapData(tmp, level);
+						_resource.uploadFromBitmapData(tmp, level);
 						
 						transform.scale(.5, .5);
 						level++;

				_bitmapData.draw(bitmapData);
			}
			
			if (_texture
				&& (mipmap != _mipmap
					|| bitmapData.width != _width
					|| bitmapData.height != _height))
			{
				_texture.dispose();
				_texture = null;
			}

			_width = _bitmapData.width;


		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,
