This happens to me a lot on my HP laptop. The problem is you have a lower backlight setting for battery, which is normal, and your power cord is disconnecting and reconnecting. This doesn't mean the cord is literally going in and out of the slot -- the cord is likely worn, like mine, and just needs a little jiggle to "reconnect". If that doesn't work, then you should call the manufacturer and have them replace the cord. I'm on my second now, and it's getting worn (also a 2 year old laptop). The first one completely wouldn't make a connection with the receiver in the laptop, and I thought it was a problem with the laptop end. I freaked out, but did some research and found out it was just the cord being dead.
If your "brick" (the little power converter box on the cord) seems to be getting excessively hot, then it's probably not working very efficiently. A surefire way to figure out if it's the cord is while it's plugged in, when the screen dims randomly, look at the battery icon in the tray by the clock. If it appears without the cord next to it (aka it's battery power), then you know for sure.