I keep getting asked why my iPhone camera flash flashes whenever I receive a phone call, text message or email, which is actually really useful especially when you are in a noisy environment. Someone even mentioned that they were about to develop an app to do just that.,, no need:
Go to Settings –> General –> Accessibility
And enable: LED flash for alerts
I have to say, this works on my iPhone 4 in silent mode and when ringer is on. Plus for my mobile it worked on calls and texts. Drove me nuts in the middle of the night.