Outer thigh thing sounds like the IT band maybe. If you poke around the outside of your thigh, coming down from your glutes and you feel tender bits, good chance the IT band is rpetty involved.
The clicking hip thing on flexion is usually the psoas muscle, you can try some psoas stretching and see if it helps. If you do a job (or anything else) where you sit for long periods of time, both of these problems will be exacerbated.http://en.wikipedia.org/wiki/Psoas_major_musclehttp://www.floota.com/PsoasStretch1.html
That is best stretch IMO, there is another common one where you are doing the same thing but simply propped up the back knee, I have never had any luck with that stretch.http://www.floota.com/QuadratusLumborumStretch1.html
Here's a QL stretch (antagonist to psoas), you could also stretch that a bit, this stretch also helps with HIT band on the other side, so you'd be getting everything.