A fear of heights on buildings is very common because there are natural vestibular and vertigo responses within certain height ranges. Furthermore, the effect is heightened if you're exposed to the elements out on a balcony as opposed to within the building.
Fear of flying is almost always related to the sensations of landing and taking off. If you've flown before you'll notice that those two events are very turbulent and it even seems amazing that some airplanes can stay together. However, once in the air you don't have the same effects of acrophobia that many people have on high buildings. Essentially, all perspective of height is removed when you look out the window of an airplane and thus the cues that trigger acrophobia. Your brain sees it like a painting of things in the distance and doesn't process it as height in the same way at all.
Brandt, T., Arnold, F., Bes, W., & Kapteyn, T. S. (1989). "The mechanism of physiological height vertigo. I. Theoretical approach and psychophysics". Acta Otolaryngol, 5-6, 513-23.