The D4 light flashing means the car's computer detected a transmission problem and stored a specific code. You need to determine the code before you troubleshoot further. I would stop by a parts store and have them scan for code(s). Your connector is behind the ash tray.
You can also read the thread called How to get CEL codes in the DIY section if you want to do it the OBD1 way.
Post the code on here, and we can help you figure out the problem.
2005 Acura TSX MT