IPhone 4 screen didn't dim just one time?

So at around 5:45 I decided to check my voicemail. And I left my phone on thinking it would turn itself off so I'm laying in bed. I see a flash of light appear. I'm like what? I feel around and feel I'm laying down on my iphone 4 could this be why the screen didn't turn off? I tryed rubbing my phone on my shirt to see if the touch screen would work though it but it didn't is the screen pressure sensitive or something?

You might have pressed the key by mistake so that can be a reason