You need very good contacts inside an airline. Personal contacts with captain and the like. Sometimes you still can get jump seat flights (a rather uncomfortable seat used for ferrying extra crew) in the cockpit.
I saw the cockpit of an American Airlines plane when I was about 11 years old, and disappointed the captain when I was confused by his American humour.
Edit: I'm in Europe, not sure how American airlines handle it.