Vehicle not running smoothly

In addition to the bucking,the check engine light keeps flashing on the dash when this happens,

flashing check engine not good. Go to AutoZone or somewhere similar and get the code read.

It was the ignition wires,had them replaced,car is fine!