What they all said.
The spark as you call it is most likely because your AC is in the on position and when you plug in that is where the draw is. NOT good. Always shut shore breaker off first before plugging in and unplugging. I go one step further and always shut my air down before doing either one.