My interior lights were flickering on and off, what could be the problem?

My interior lights were flickering on and off but I wasn't driving or anything. I had it in park and I did have the driver s door open it was night time too. I don't know what could be the problem btw it's a ford 500 2005.
It was raining all day so maybe the water gpt inside something but it wasn't raining when I had the door open. Oh btw it was also making a service ding ding npise too with every flickering.

You may have a bad door jam switch.