What you describe, sounds to me very much like the sort of thing warranties are for. There's probably some sort of very specific short in the power supply of the laptop, that's only activated when drawing power from the AC adapter.
I'd back up everything you don't want to lose and take the thing back for a replacement. If it's out of the replacement period, make a warranty claim.
If the AC is connected the laptop doesn't boot. It tries for 2 seconds and the noise stops. I have to let the laptop charging the battery while it is off and then after a couple hours I unplug the AC and use the computer normally. Everything works, but if I try to connect the AC the pc shuts down. I've done many things trying to fix it. First I updated everything... Windows (XP), drivers and softwares. I couldn't update the bios because I have to have the AC plugged to do that and if I plug the AC the pc turns off. I reset the memory and the hard drive. I ran the scan disk, defrag, Spybot, Ad-aware and Ccleaner. I have tried many AC adapters, the battery is new and so far it last almost 3 hours. I connected the laptop to another monitor to see if I'd still have the same issue and same problem. Even in safe mode the same problem occurs. The restore system didn't solve the problem either. I opened the laptop, but honestly I have no idea what should I do there, so I closed it and everything still the same. Can somebody help me solving this mystery??? Thank you.