What would cause the headlights to flash on and off while the car is shut off and parked?

It is possible that the headlights are activated by the alarm. If that is not the case, if it has auto turn on headlights the module can be going bad. Other than that I don't know.