Magnetic fields in flares and active prominences