Howdy all,
Apart from flights with the company I work for, I have gained access to the flight deck after the flight only. I haven't asked to visit the flight deck during flight, but I showed the cabin crew ASIC card (Airport Security ID) and asked them if, after all the pax had disembarked, I could get some photos of the flight deck on the Virgin Blue PER-SYD flight. Turns out the Captain was an ex-NJS pilot (Where I work) and he was more than happy to let me in.
Airline workers prolly have a better chance than most I reckon if they show their Airport ID.
Cheers,