When you say flash do you mean brighter or dimming like low voltage , would explain why it clears when pulling off , higher revs = increased voltage , stationary /tick over = lower voltage.
I'm no lektrician but had similar on old bike and turned out the battery was toast.