I have had this sort of thing happen to a few laptops here. If the battery is faulty it can have this affect, do as micker377 suggests & remove the battery, then plug the mains adapter in. If you can switch the machine on, you will need to replace the battery.
Also the other suggestion from micker377 about the power socket is very important. It may seem OK from the outside, but the socket may have become loose on the motherboard. You would need to remove the mobo from the case & resolder the joints if this is the case. I have only done this on laptops that are out of warranty. Sometimes the plastic on the socket also breaks down if the socket starts moving on the mobo.
If you are not confident with a soldering iron or taking the machine apart, then take it or send it to a qualified laptop repair specialist.