What resolution are you trying to get?
Have you tried a mini display port cable? [the thunderbolt port]
If the resolution is too high [ say above 1920 x 1080 for a TV] you won't get a clear signal.
For high resolution using DVI [say 2560 x 1600] you need a dual link DVI cable. A standard DVI doesn't have the thoughput to give you a clear signal.
Without more information, I can't suggest anything else.
I am usign the 1920x1080 resolution. I have set it in some ridiculos
low resolutions such as 1600x900 and it still flickering.
I bought a hdmi to mini display port adapter but it is not with me yet. I shouldent have bought it since the hdmi is supost to work . But I spent to holping to end this torture and finaly can use the computer.