I don't know for sure, but I would guess you have your energy preferences set to best performance for when it is plugged in and to better battery life during battery use.
go into your system preferences and select energy preferences and adjust
Thats correct, the answer is in the Energy Saver, under settings for battery. Just go to option and uncheck Reduce the brightness of the built-in display when using this power source. That will keep the LCD from dimming.