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

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

				}
				else
				{
					_resource.uploadFromBitmapData(_bitmapData, 0);
				}
				
				_bitmapData.dispose();
			}
			else if (_atf)
			{
				_resource.uploadCompressedTextureFromByteArray(_atf, 0, false);
			}
		}
		
		public function dispose() : void
		{
			if (_resource)
			{
				_resource.dispose();
				_resource = null;
			}
		}
	}
}
